Skip to content

Async executor tests: wait for idle after wait_completion() (#210) - #211

Merged
tae898 merged 1 commit into
mainfrom
fix/210-async-tests-wait-for-idle
Nov 3, 2026
Merged

tae898 merged 1 commit into
mainfrom
fix/210-async-tests-wait-for-idle

Conversation

@tae898

@tae898 tae898 commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Closes #210

Four tests in tests/test_async_executor.py asserted that the executor is idle right after wait_completion() returned. Engine 26.11.1-SNAPSHOT from ArcadeData/arcadedb#11191 (nightly image since 2026-11-03 08:07 UTC, commit 7399c0d73) releases the waiter when the last marker counts down, and the worker clears its executing flag a few instructions later, so is_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 on dc99d16b7. The measurements are in #210.

The engine follows its new javadoc here, so the fix is in the tests: a _wait_until_idle() helper polls is_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). The wait_completion() docstring now says its return does not make is_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

…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>
@tae898
tae898 merged commit 413f54f into main Nov 3, 2026
72 of 74 checks passed
@tae898
tae898 deleted the fix/210-async-tests-wait-for-idle branch November 3, 2026 13:40
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.

Async executor tests assert idle right after wait_completion(); engine 7399c0d73 returns a moment earlier

1 participant