Repository navigation
nextest: run test_many_concurrent alone - #65
Open
mostafa-yassine wants to merge 1 commit into
Open
mostafa-yassine wants to merge 1 commit into
mostafa-yassine wants to merge 1 commit into
Conversation
Under cfg(test) libsql-server sets TXN_TIMEOUT to 100 ms and libsql-sys sets a 100 ms busy timeout. test_many_concurrent runs 3 tasks x 1000 BEGIN IMMEDIATE against those limits, so it fails with DatabaseBusy whenever other test binaries compete for CPU. nextest's schedule is deterministic for a given test set, so adding any test elsewhere in the workspace can shift it into a contended slot and make it fail on every retry (#62: 8 of 8 tries). Reserve all CPUs for it so it never shares the runner.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
libsql-serverconnection::connection_core::test::test_many_concurrentruns 3 tasks x 1000BEGIN IMMEDIATEtransactions. Undercfg(test),TXN_TIMEOUTis 100 ms (libsql-server/src/connection/mod.rs:39) andlibsql-syssets a 100 ms SQLite busy timeout (libsql-sys/src/connection.rs:269). The test's own doc comment says: "If this test becomes flaky check out the lock stealing code."Problem
The test fails with
SqliteFailure(DatabaseBusy, "database is locked")atconnection_core.rs:676, or times out at 60 s, whenever other test binaries compete for the runner's CPUs. nextest's schedule is deterministic for a given set of tests, so adding tests anywhere in the workspace can move it into a contended slot and make it fail on every retry.Evidence from #62, which adds two unit tests to the
libsqlcrate and touches nothing inlibsql-server:v0.9.30-shopify-patches+ empty commit ([DO NOT MERGE] CI probe: does test_many_concurrent fail on base? #64): 454 tests,test_many_concurrentPASS in 4.7 s.test_many_concurrentFAIL 8 of 8 tries across two runs. Same runner image (ubuntu-24.0420261018.339.1), same rustc, same cargo cache key.Solution
Add a nextest override that reserves all CPUs for this test (
threads-required = 'num-cpus'). nextest then runs it with nothing else in flight. No change to the test or to lock stealing.Testing
CI on this PR. After merge, #62 rebases onto it.