Project: datamanagement
Issue DM-3540: Refactor ChunkResource for testability
While the wdb/testChunkResource.cc unit test appears to exercise the chunk resource management code, it does not seem to actually test it. We should refactor the classes in the ChunkResource header and implementation files to make the sanity of the implementation checkable. In particular, I think that Backend from ChunkResource.cc should be a public interface (with a less generic name) that the unit test can implement, and that ChunkResourceMgr should be a concrete class implemented in terms of a user specifiable Backend. This way the unit test can inject the dependency it wants (namely a mock backend that tracks sub-chunk tables as they are acquired and released), we don't pollute the actual implementation classes with "I'm fake" flags and alternate code paths for fake objects, and we can make the unit test actually perform validity tests. The first cut at this should include a check for the problem described in DM-3522.
Story points: 4