Skip to content

Commit

Permalink
[FLINK-8138] [tests] Fix TaskAsyncCallTest#testSetsUserCodeClassLoader
Browse files Browse the repository at this point in the history
The problem was a race condition between the triggerCheckpoint and the wait
loop which had as termination condition the number of received trigger checkpoint
messages.
  • Loading branch information
tillrohrmann committed Feb 24, 2018
1 parent c73f94e commit 28c2616
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import org.apache.flink.runtime.state.TestTaskStateManager;
import org.apache.flink.runtime.util.TestingTaskManagerRuntimeInfo;
import org.apache.flink.util.SerializedValue;
import org.apache.flink.util.TestLogger;

import org.junit.Before;
import org.junit.Test;
Expand All @@ -78,7 +79,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class TaskAsyncCallTest {
public class TaskAsyncCallTest extends TestLogger {

/** Number of expected checkpoints. */
private static int numCalls;
Expand Down Expand Up @@ -289,7 +290,7 @@ public void invoke() throws Exception {

// wait forever (until canceled)
synchronized (this) {
while (error == null && lastCheckpointId < numCalls) {
while (error == null) {
wait();
}
}
Expand Down

0 comments on commit 28c2616

Please sign in to comment.