Skip to content
Snippets Groups Projects
Commit b1335018 authored by Marcelo Vanzin's avatar Marcelo Vanzin
Browse files

[SPARK-21522][CORE] Fix flakiness in LauncherServerSuite.

Handle the case where the server closes the socket before the full message
has been written by the client.

Author: Marcelo Vanzin <vanzin@cloudera.com>

Closes #18727 from vanzin/SPARK-21522.
parent 97ccc63f
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,7 @@ import java.io.IOException;
import java.io.ObjectInputStream;
import java.net.InetAddress;
import java.net.Socket;
import java.net.SocketException;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.BlockingQueue;
......@@ -171,7 +172,15 @@ public class LauncherServerSuite extends BaseSuite {
LauncherServer.getServerInstance().getPort());
client = new TestClient(s);
client.send(new EvilPayload());
try {
client.send(new EvilPayload());
} catch (SocketException se) {
// SPARK-21522: this can happen if the server closes the socket before the full message has
// been written, so it's expected. It may cause false positives though (socket errors
// happening for other reasons).
}
waitForError(client, handle.getSecret());
assertEquals(0, EvilPayload.EVIL_BIT);
} finally {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment