Repository navigation
Async batch unit tests: no thread count across tests, a clock step between two batches, and the state of a hand-over that does not come - #455
Merged
Conversation
…tween two batches, and the state in the message of a hand-over that does not come (refs #451)
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.
What does this PR do?
It removes two timing assumptions from
tests/test_native_async_create_batch_unit.pythat failed onmainin the red-main issue #451, and makes the third failure of that run say what it holds. It is a tests-only change, no source file changes.The run was 45056236348 on
076d6d5, native parity, Python 3.12. The test file failed on both runners, and it is not related to the pull request that was merged there (#398).test_an_executor_starts_no_thread_of_its_ownassert 27 == 28onthreading.active_count()test_the_entry_of_an_earlier_batch_does_not_cut_a_later_batch_shortassert 577.8340000000001 > 577.8340000000001test_the_order_of_the_calls_holds_across_linger_hand_overs_and_flush_pointsassert Falseafter_wait_for, and the file took 10.96 sthreading.active_count()before and after it made 20 executors. A thread of an earlier test that ends in between (a short-lived hand-over thread) lowers the count, so the test failed although no executor had started a thread. It now compares the set of threads and fails only on a thread that did not exist before.time.monotonic()on Python 3.12) moves in steps of about 16 ms, so two batches that start within one step get the same due time andsecond_due > first_dueis false. The test now waits for the clock to move between the two batches. The code under test is unchanged. From reading_LingerI expect it to cope with an equal due time (the entry that fires hands over whatever is waiting, the other entry finds nothing and is dropped), but I did not run that case._wait_forran into its limit of 10 s in the call-order test on Windows. I did not find a cause by reading_LingerandNativeAsyncExecutor: the same file passed on the other runs ofmain, and I cannot run Windows here. The test now puts the state in its failure message (the calls seen, the due time, the buffer, the stored error, the heap of the linger thread, whether the thread is alive, and the clock), so the next occurrence names the cause. I left this one open on purpose: Full CI is red on main: Test native (arcadedb) #451 stays open until a Windows run shows what it was or it has not come back for a while.Related issues
Refs #451. It stays open for the third item.
Docs
None needed.
Checklist
uvx pre-commit run --files tests/test_native_async_create_batch_unit.pypasses.