Repository navigation
Update PortableTimersExecutionTest to use PAssert, to prevent a concurrency issue, collecting the pipeline results - #7214
Merged
mxm merged 2 commits intoDec 6, 2018
Conversation
…rrency issue collecting the test results.
ajamato
force-pushed
the
java_sdk_metrics_enqueuing_receiver_fixup_flink_test
branch
from
December 5, 2018 21:14
a4617b6 to
a466104
Compare
Author
amaliujia
reviewed
Dec 5, 2018
| .apply(ParDo.of(collectResults)); | ||
| PCollection<KV<String, Integer>> output = | ||
| pipeline.apply(Impulse.create()).apply(ParDo.of(inputFn)).apply(ParDo.of(testFn)); | ||
| PAssert.that(output).containsInAnyOrder(expectedOutput); |
Contributor
There was a problem hiding this comment.
+1 to use PAssert to verify result of a Pipeline.
mxm
approved these changes
Dec 6, 2018
| jobInvocation.start(); | ||
| long timeout = System.currentTimeMillis() + 60 * 1000; | ||
| long timeout = System.currentTimeMillis() + 2 * 60 * 1000; | ||
| while (jobInvocation.getState() != Enum.DONE && System.currentTimeMillis() < timeout) { |
Contributor
There was a problem hiding this comment.
To further improve this test: We can remove the timeout related logic here. The test already has a timeout set above.
| while (jobInvocation.getState() != Enum.DONE && System.currentTimeMillis() < timeout) { | ||
| Thread.sleep(1000); | ||
| } | ||
| assertThat(jobInvocation.getState(), is(Enum.DONE)); |
Contributor
There was a problem hiding this comment.
We can also remove this line if we remove the timeout because the while loop will only return when it is done.
| .apply(ParDo.of(collectResults)); | ||
| PCollection<KV<String, Integer>> output = | ||
| pipeline.apply(Impulse.create()).apply(ParDo.of(inputFn)).apply(ParDo.of(testFn)); | ||
| PAssert.that(output).containsInAnyOrder(expectedOutput); |
Author
|
@mxm I made the change that you suggested above. Would you please merge this once the presubmit finishes. Thanks again. |
Contributor
|
Thank you @ajamato! Will merge when I have green light. |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…rrency issue collecting the test results.
Please add a meaningful description for your change here
Follow this checklist to help us incorporate your contribution quickly and easily:
[BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replaceBEAM-XXXwith the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.It will help us expedite review of your Pull Request if you tag someone (e.g.
@username) to look at it.Post-Commit Tests Status (on master branch)