You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Zhu Zhu (Jira)" <ji...@apache.org> on 2020/02/27 07:41:00 UTC
[jira] [Resolved] (FLINK-16234) Fix unstable cases in
StreamingJobGraphGeneratorTest
[ https://issues.apache.org/jira/browse/FLINK-16234?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Zhu Zhu resolved FLINK-16234.
-----------------------------
Resolution: Fixed
Fixed via:
master: 39e75eb2f1be9f6ce872e558bb8cf234897dfbfc
release-1.10: af0f78b4083226a05e7dfc036938793237df5fff
> Fix unstable cases in StreamingJobGraphGeneratorTest
> ----------------------------------------------------
>
> Key: FLINK-16234
> URL: https://issues.apache.org/jira/browse/FLINK-16234
> Project: Flink
> Issue Type: Bug
> Affects Versions: 1.10.0
> Reporter: cpugputpu
> Priority: Minor
> Labels: pull-request-available
> Fix For: 1.10.1, 1.11.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> The test in _org.apache.flink.streaming.api.graph.StreamingJobGraphGeneratorTest#testSlotSharingOnAllVerticesInSameSlotSharingGroupByDefaultDisabled_ will cause the following failure:
> java.lang.AssertionError: expected:<SlotSharingGroup feca28aff5a3958840bee985ee7de4d3> but was:<SlotSharingGroup 798f7268aeb5fde00858b7c9723d65f1>
> at org.apache.flink.streaming.api.graph.StreamingJobGraphGeneratorTest.assertSameSlotSharingGroup(StreamingJobGraphGeneratorTest.java:843)
> at org.apache.flink.streaming.api.graph.StreamingJobGraphGeneratorTest.testSlotSharingOnAllVerticesInSameSlotSharingGroupByDefaultDisabled(StreamingJobGraphGeneratorTest.java:814)
> I analyze the assertion failure and find that the root cause of it lies in the clear() method in StreamGraph.java, where the variable _sources_ is initialized as a HashSet. Because the iteration order of HashSet is non-deterministic, so the test becomes flaky.
> The fix is to change _HashSet_ to _LinkedHashSet_ and then the failure above is removed.
>
> The stacktrace information is presented as follows for your reference:
> java.util.HashSet.iterator(HashSet.java:173)
> org.apache.flink.streaming.api.graph.StreamingJobGraphGenerator.setChaining(StreamingJobGraphGenerator.java:251)
> org.apache.flink.streaming.api.graph.StreamingJobGraphGenerator.createJobGraph(StreamingJobGraphGenerator.java:166)
> org.apache.flink.streaming.api.graph.StreamingJobGraphGenerator.createJobGraph(StreamingJobGraphGenerator.java:104)
> org.apache.flink.streaming.api.graph.StreamingJobGraphGenerator.createJobGraph(StreamingJobGraphGenerator.java:100)
> org.apache.flink.streaming.api.graph.StreamingJobGraphGeneratorTest.testSlotSharingOnAllVerticesInSameSlotSharingGroupByDefaultDisabled(StreamingJobGraphGeneratorTest.java:803)
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)