Skip to content

fix: [Parallel] Fix a flaky parallel test#271

Merged
zhongkechen merged 1 commit intomainfrom
fix/parallel_test
Mar 26, 2026
Merged

fix: [Parallel] Fix a flaky parallel test#271
zhongkechen merged 1 commit intomainfrom
fix/parallel_test

Conversation

@wangyb-A
Copy link
Copy Markdown
Contributor

@wangyb-A wangyb-A commented Mar 26, 2026

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Issue Link, if available

#261

Description

  • Fix flaky test by using a concurrent hashmap in mockito mocking, instead of setting up the stub everytime the mocked execution manager received sendOperationUpdate call.

Demo/Screenshots

Checklist

  • I have filled out every section of the PR template
  • I have thoroughly tested this change

Testing

Unit Tests

Have unit tests been written for these changes?

Integration Tests

Have integration tests been written for these changes?

Examples

Has a new example been added for the change? (if applicable)

@wangyb-A wangyb-A requested a review from a team March 26, 2026 00:20
when(executionManager.getOperationAndUpdateReplayState(OPERATION_ID))
.thenReturn(succeededParallelOp);
// Write before completing the future — ConcurrentHashMap guarantees visibility.
operationStore.put(OPERATION_ID, succeededParallelOp);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the only case that is flaky?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes I believe so, this is the only place we mock the real backend behaviour

@zhongkechen zhongkechen merged commit 63f4e7a into main Mar 26, 2026
12 checks passed
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.

2 participants