Commit c18f849
[SPARK-24663][STREAMING][TESTS] StreamingContextSuite: Wait until slow receiver has been initialized, but with hard timeout
### What changes were proposed in this pull request?
This patch fixes the flaky test failure from StreamingContextSuite "stop slow receiver gracefully", via putting flag whether initializing slow receiver is completed, and wait for such flag to be true. As receiver should be submitted via job and initialized in executor, 500ms might not be enough for covering all cases.
### Why are the changes needed?
We got some reports for test failure on this test. Please refer [SPARK-24663](https://issues.apache.org/jira/browse/SPARK-24663)
### Does this PR introduce any user-facing change?
No
### How was this patch tested?
Modified UT. I've artificially made delay on handling job submission via adding below code in `DAGScheduler.submitJob`:
```
if (rdd != null && rdd.name != null && rdd.name.startsWith("Receiver")) {
println(s"Receiver Job! rdd name: ${rdd.name}")
Thread.sleep(1000)
}
```
and the test "stop slow receiver gracefully" failed on current master and passed on the patch.
Closes #25725 from HeartSaVioR/SPARK-24663.
Authored-by: Jungtaek Lim (HeartSaVioR) <kabhwan@gmail.com>
Signed-off-by: Marcelo Vanzin <vanzin@cloudera.com>1 parent b62ef8f commit c18f849
File tree
1 file changed
+8
-4
lines changed- streaming/src/test/scala/org/apache/spark/streaming
1 file changed
+8
-4
lines changedLines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | | - | |
350 | 349 | | |
351 | 350 | | |
352 | 351 | | |
| |||
358 | 357 | | |
359 | 358 | | |
360 | 359 | | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
361 | 363 | | |
362 | 364 | | |
363 | 365 | | |
| |||
949 | 951 | | |
950 | 952 | | |
951 | 953 | | |
| 954 | + | |
952 | 955 | | |
953 | 956 | | |
954 | 957 | | |
| |||
958 | 961 | | |
959 | 962 | | |
960 | 963 | | |
961 | | - | |
| 964 | + | |
962 | 965 | | |
963 | 966 | | |
964 | 967 | | |
965 | 968 | | |
966 | 969 | | |
| 970 | + | |
967 | 971 | | |
968 | 972 | | |
969 | 973 | | |
970 | 974 | | |
971 | | - | |
| 975 | + | |
972 | 976 | | |
973 | 977 | | |
974 | 978 | | |
975 | 979 | | |
976 | 980 | | |
977 | 981 | | |
978 | 982 | | |
979 | | - | |
| 983 | + | |
980 | 984 | | |
981 | 985 | | |
982 | 986 | | |
| |||
0 commit comments