Repository navigation
Async executor tests: wait for idle after wait_completion() (#210) - #211
Merged
Merged
Conversation
…er wait_completion() (#210) Engine 26.11.1-SNAPSHOT (ArcadeData/arcadedb#11191) ends waitCompletion() when the last marker releases the waiter, not on an isProcessing() poll, so a worker can still flag itself as executing for an instant after wait_completion() returns. Four tests asserted "idle now" at that point and failed on the nightly image. They now wait, with a deadline, for is_processing() to turn False. The wait_completion() docstring says what its return does and does not promise. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #210
Four tests in
tests/test_async_executor.pyasserted that the executor is idle right afterwait_completion()returned. Engine26.11.1-SNAPSHOTfrom ArcadeData/arcadedb#11191 (nightly image since 2026-11-03 08:07 UTC, commit7399c0d73) releases the waiter when the last marker counts down, and the worker clears its executing flag a few instructions later, sois_processing()can answer True once with nothing left to run. A Java program (1000 rounds, JDK 25) saw this 48 times at parallel level 1 and 343 times at level 3 on the new engine, and 0 times ondc99d16b7. The measurements are in #210.The engine follows its new javadoc here, so the fix is in the tests: a
_wait_until_idle()helper pollsis_processing()with a deadline, and the four tests call it before their "idle now" assertions (pending_and_processing_flags,is_pending_true_while_queued,wait_completion_zero_returns_when_idle,wait_completion_commits_everything_queued_including_the_tail). Thewait_completion()docstring now says its return does not makeis_pending()False at once.Checks run:
compile,pyflakes, pre-commit on both files. The JVM suite runs on the branch through "Test JVM (arcadedb-jvm)" against the same nightly image.🤖 Generated with Claude Code