Skip to content

test: accept a late signal in AwaitSignalTest.signaled - #1889

Closed
mvanhorn wants to merge 1 commit into
lysine-dev:mainfrom
mvanhorn:fix/1509-await-signal-test-flake
Closed

mvanhorn wants to merge 1 commit into
lysine-dev:mainfrom
mvanhorn:fix/1509-await-signal-test-flake

Conversation

@mvanhorn

Copy link
Copy Markdown

Why

The test can fail when a signal arrives late, even though the wait returns before its timeout.

AwaitSignalTest.signaled checked elapsed time against a narrow expectation of 1000 ms. Scheduling the signal after 1000 ms does not guarantee it will execute that promptly.

What changed

The test now records that the scheduled callback signaled the condition while holding the lock and checks that flag after the wait returns. It accepts elapsed times of at least 950 ms and less than 4500 ms, allowing scheduling delays while keeping completion below the configured 5000 ms timeout.

Testing

The compilation check ./gradlew --no-daemon :okio:testClasses timed out after 300 seconds; no test execution was shown.

Fixes #1509

The test now records that the scheduled callback signaled the condition
while holding the lock and checks that flag after the wait returns. It
accepts elapsed times of at least 950 ms and less than 4500 ms, allowing
scheduling delays while keeping completion below the configured 5000 ms
timeout.

Refs lysine-dev#1509
@JakeWharton

Copy link
Copy Markdown
Collaborator

LLM code and PR/issue descriptions are forbidden per the contribution policy. This is your only warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

AwaitSignalTest.signaled is flaky

2 participants