Skip to content

Commit 8d52338

Browse files
author
Marcelo Vanzin
committed
Fix a test to test the right error.
1 parent 9c7d2d3 commit 8d52338

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

launcher/src/test/java/org/apache/spark/launcher/LauncherServerSuite.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import java.util.concurrent.LinkedBlockingQueue;
3131
import java.util.concurrent.Semaphore;
3232
import java.util.concurrent.TimeUnit;
33+
import java.util.concurrent.atomic.AtomicBoolean;
3334

3435
import org.junit.Test;
3536
import static org.junit.Assert.*;
@@ -198,12 +199,12 @@ private void close(Closeable c) {
198199
* server-side close immediately.
199200
*/
200201
private void waitForError(TestClient client, String secret) throws Exception {
202+
final AtomicBoolean helloSent = new AtomicBoolean();
201203
eventually(Duration.ofSeconds(1), Duration.ofMillis(10), () -> {
202-
boolean helloSent = false;
203204
try {
204-
if (!helloSent) {
205+
if (!helloSent.get()) {
205206
client.send(new Hello(secret, "1.4.0"));
206-
helloSent = true;
207+
helloSent.set(true);
207208
} else {
208209
client.send(new SetAppId("appId"));
209210
}

0 commit comments

Comments
 (0)