-
Notifications
You must be signed in to change notification settings - Fork 386
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
Drop OnceCell
in lightning-transaction-sync
tests
#2132
Drop OnceCell
in lightning-transaction-sync
tests
#2132
Conversation
This looks good too, but I thought previously you'd decided the runtime of the tests was too high this way? We could still pretty trivially make this globals by just having each test set some flag on completion (or panic) + clean everything off when a defined number of tests complete? |
Well, currently the the test cases are partitioned based on feature flags (
There will be some more test cases introduced with the Electrum version, but it still probably would be an insignificant difference as it will also rely on feature flags, meaning that it will likely be tested via separate |
Codecov ReportPatch coverage has no change and project coverage change:
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #2132 +/- ##
==========================================
+ Coverage 91.42% 91.66% +0.24%
==========================================
Files 101 101
Lines 49552 51789 +2237
Branches 49552 51789 +2237
==========================================
+ Hits 45304 47474 +2170
- Misses 4248 4315 +67 see 8 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
CI failures are unrelated, see #2133. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Feel free to squash the fixup.
`OnceCell` doesn't call `drop`, which makes the spawned `bitcoind`/`electrsd` instances linger around after our tests have finished. To fix this, we move them out of `OnceCell` and let every test that needs them spawn their own instances. This additional let us drop the `OnceCell` dev dependency.
8df5719
to
7b85eba
Compare
Squashed without further changes. |
Unfortunately,
OnceCell
never callsdrop
upon termination, which makes the spawnedbitcoind
/electrsd
instances linger around after our tests have finished. This had previously led to spurious failures such as:To fix this, we simply move the instances out of
OnceCell
and let every test that needs them spawn their own instances. This might introduce a small overhead over the shared-state version, which however is likely not that bad as long as the number of tests is not growing immensely. It additional lets us drop theOnceCell
dev dependency.