fix(test): remove race-inducing idle tick from test data in test_detach_keeps_draining_into_buffer (#73854) - #73856
Closed
kyssta-exe wants to merge 1 commit into
Closed
Conversation
…ch_keeps_draining_into_buffer (NousResearch#73854)
Contributor
|
Thanks @kyssta-exe — closing as resolved: |
1 task
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.
Problem
test_detach_keeps_draining_into_bufferusesFakeBridge([b"one", b"", b"two"])whereb""is a literal idle tick between the two real chunks. In PtySession._drain(), ab""chunk triggersawait asyncio.sleep(0)followed by anotherrun_in_executorround-trip beforeb"twocan be consumed. The 50msasyncio.sleepin the test is often insufficient for this extra executor hop — the test fails intermittently withassert replay == b"onetwo"where onlyb"one"has arrived.Fix
Remove the
b""idle tick from the test data. The FakeBridge naturally returnsb""(idle) when its chunk list is exhausted, so removing the in-band idle tick doesn't reduce what the test validates — it still proves the drain continues after detach and accumulates data into the buffer.Verification
Closes #73854