-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to use ConcurrentMap for StringSetData #33057
Conversation
tested that the test before this change reliably fails with
|
Assigning reviewers. If you would like to opt out of this review, comment R: @lostluck added as fallback since no labels match configuration Available commands:
The PR bot will only process comments in the main thread (not review comments). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest of this LGTM.
for (long i = 0; !finished.get(); ++i) { | ||
cell.add(String.valueOf(i)); | ||
try { | ||
Thread.sleep(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1s sleep in a 3s test doesn't give much room to find races.
Does this test fail without your changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it is 1 ms sleep. it does - #33057 (comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My mistake. I was thinking Python where it's in seconds and not ms.
runners/core-java/src/test/java/org/apache/beam/runners/core/metrics/StringSetCellTest.java
Outdated
Show resolved
Hide resolved
while (true) { | ||
Set<String> s = cell.getCumulative().stringSet(); | ||
List<String> snapshot = new ArrayList<>(s); | ||
if (Instant.now().isAfter(start.plusSeconds(3)) && snapshot.size() > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should assert that the contents of the snapshot are not corrupt.
Maybe we keep track of the highest integer reached by the thread, and assert that at the end, the snapshot contains all of [0, N].
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, added assert.
GCP IO PreCommit failing SpannerChangeStream test |
Fix #33054
Please add a meaningful description for your change here
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123
), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>
instead.CHANGES.md
with noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.