slfan1989 opened a new pull request, #1649:
URL: https://github.com/apache/ratis/pull/1649

   ## 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 is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to