Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(test): clear and close lmdb after each test suite #36343

Merged
merged 6 commits into from
Aug 11, 2022
Merged

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Aug 9, 2022

Description

First problem - our test suites are not really isolated when it comes to lmdb - once lmdb is opened in a process it will remain opened until closed.

Second problem - global is resetted between test suites/files - that means neither we or lmdb internally can use anything "global" like to prevent opening new dbs in new test suites tespite those dbs being in fact already openend.

This PR does few things:

  • make use of custom environment to just close all lmdb instances after test suite is done to prevent dangling open handles (it can read global object for the test suite that might have been mutated - in our case references to open lmdb dbs)
  • add global tracking for cache-lmdb (we already use it for datastore)

Related Issues

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Aug 9, 2022
@pieh pieh removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Aug 10, 2022
@pieh pieh changed the title just checking flaky windows tests fix(test): clear and close lmdb after each test suite Aug 10, 2022
@pieh pieh marked this pull request as ready for review August 10, 2022 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants