Closed tiero closed 3 years ago
Thanks for taking the first steps on this. I'll review and see where we can go next when I get some time.
I had the same issues with DB close in my PR. I'm going to close this one in favor of the other one, due to all the import path rewrites.
They must have made some concurrency and memory fixes in V2 of badger, because I was able to move back to opening a separate DB for each test as opposed to using one shared global DB.
I believe the Key issue was due to fact that the DropAll
call I needed to make between each test didn't lock reads, so I think there were tests trying to read data that had been dropped between tests (https://godoc.org/github.com/dgraph-io/badger#DB.DropAll).
Moving to a separate DB opened and closed between tests prevented any side effects like that from causing issues.
This is not meant to be merged, but rather a PoC for v2 support.
I renamed the go module package name to be able to import in a project that uses badger v1 and it seems to work without any problem. So will be reverted ofc.
I had a problem with the badgerhold
Close
method in the TestMain instore_test.go
, which will return alwaysKey not found
. could be linked to #36 ? Anyhow would be weird, the database is opened and closed right away, no data is inserted. Please @timshannon advise on itDon't know how to make this configurable. We may need to import both badger version in all files and conditionally switch based on what the user choose? I think would be better have a seprate branch/tag to pull the specific badgerhold version
This should closes #21