Skip to content

RATIS-2760. Fix flaky ReadOnlyRequestWithLongTimeoutTests.testLinearizableReadParallel - #1649

Open
slfan1989 wants to merge 1 commit into
apache:masterfrom
slfan1989:RATIS-2760
Open

slfan1989 wants to merge 1 commit into
apache:masterfrom
slfan1989:RATIS-2760

Conversation

@slfan1989

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Replace the fixed 100 ms sleep in testLinearizableReadParallel with explicit synchronization using a test state machine.

The test waits until the asynchronous write enters applyTransaction and blocks it before updating the counter. It then verifies that the stale read returns 1, initiates a linearizable read, releases the write, and verifies that the linearizable read returns 2.

This removes the timing assumption that could cause the linearizable read to return 1 when the asynchronous write was delayed.

This fixes an intermittent failure observed in

https://github.com/apache/ratis/actions/runs/38951714056/job/117144457810#step:11:1420

TestReadOnlyRequestWithLongTimeoutWithGrpc.testLinearizableReadParallel
expected: <2> but was: <1>

What is the link to the Apache JIRA

JIRA: RATIS-2760. Fix flaky ReadOnlyRequestWithLongTimeoutTests.testLinearizableReadParallel

How was this patch tested?

unit tests

This branch has not been deployed

No deployments
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.

1 participant