File tree 1 file changed +4
-3
lines changed
launcher/src/test/java/org/apache/spark/launcher
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 30
30
import java .util .concurrent .LinkedBlockingQueue ;
31
31
import java .util .concurrent .Semaphore ;
32
32
import java .util .concurrent .TimeUnit ;
33
+ import java .util .concurrent .atomic .AtomicBoolean ;
33
34
34
35
import org .junit .Test ;
35
36
import static org .junit .Assert .*;
@@ -198,12 +199,12 @@ private void close(Closeable c) {
198
199
* server-side close immediately.
199
200
*/
200
201
private void waitForError (TestClient client , String secret ) throws Exception {
202
+ final AtomicBoolean helloSent = new AtomicBoolean ();
201
203
eventually (Duration .ofSeconds (1 ), Duration .ofMillis (10 ), () -> {
202
- boolean helloSent = false ;
203
204
try {
204
- if (!helloSent ) {
205
+ if (!helloSent . get () ) {
205
206
client .send (new Hello (secret , "1.4.0" ));
206
- helloSent = true ;
207
+ helloSent . set ( true ) ;
207
208
} else {
208
209
client .send (new SetAppId ("appId" ));
209
210
}
You can’t perform that action at this time.
0 commit comments