MINOR: Fix various memory leaks in tests#12959
Conversation
There was a problem hiding this comment.
Why do you close the state store in the test here but not in the other tests?
There was a problem hiding this comment.
yeah, that's a duplicate
There was a problem hiding this comment.
I think it would be enough to just optionsFacadeDbOptions.close();. You already verify that optionsFacadeDbOptions.close(); calls mockedDbOptions.close(); in the try-block. No need to verify it again.
Alternatively, you could add close to the list of ignored methods (ignoreMethods) and verify as you did. However, you need to add verify(mockedDbOptions) after optionsFacadeDbOptions.close() otherwise nothing is verified.
There was a problem hiding this comment.
I'm just doing this so that easymock doesn't complain about close being called on the unterlying mock. I want to call close here to free up resources, and the best way here is to tell easymock what to expect on the mocks.
I found an alternative way to do this via resetToNice which should be less confusing.
Various tests in the streams park were leaking native memory. Most tests were fixed by closing the corresponding rocksdb resource.
…/RocksDBGenericOptionsToDbOptionsColumnFamilyOptionsAdapterTest.java Co-authored-by: Bruno Cadonna <cadonna@apache.org>
|
Build failures are not related: |
Various tests in the streams park were leaking native memory. Most tests were fixed by closing the corresponding rocksdb resource. I tested that the corresponding leak is gone by using a previous rocksdb release with finalizers and checking if the finalizers would be called at some point. Reviewer: Bruno Cadonna <cadonna@apache.org>
Various tests in the streams park were leaking native memory.
Most tests were fixed by closing the corresponding rocksdb resource.
I tested that the corresponding leak is gone by using a previous rocksdb
release with finalizers and checking if the finalizers would be called at some
point.