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

[SPARK-10674] [TESTS] Increase timeouts in SaslIntegrationSuite.

1s seems to trigger too many times on the jenkins build boxes, so
increase the timeout and cross fingers.

Author: Marcelo Vanzin <vanzin@cloudera.com>

Closes #8802 from vanzin/SPARK-10674 and squashes the following commits:

3c93117 [Marcelo Vanzin] Use java 7 syntax.
d667d1b [Marcelo Vanzin] [SPARK-10674] [tests] Increase timeouts in SaslIntegrationSuite.
parent 4fbf3328
No related branches found
No related tags found
No related merge requests found
...@@ -56,6 +56,11 @@ import org.apache.spark.network.util.SystemPropertyConfigProvider; ...@@ -56,6 +56,11 @@ import org.apache.spark.network.util.SystemPropertyConfigProvider;
import org.apache.spark.network.util.TransportConf; import org.apache.spark.network.util.TransportConf;
public class SaslIntegrationSuite { public class SaslIntegrationSuite {
// Use a long timeout to account for slow / overloaded build machines. In the normal case,
// tests should finish way before the timeout expires.
private final static long TIMEOUT_MS = 10_000;
static TransportServer server; static TransportServer server;
static TransportConf conf; static TransportConf conf;
static TransportContext context; static TransportContext context;
...@@ -102,7 +107,7 @@ public class SaslIntegrationSuite { ...@@ -102,7 +107,7 @@ public class SaslIntegrationSuite {
TransportClient client = clientFactory.createClient(TestUtils.getLocalHost(), server.getPort()); TransportClient client = clientFactory.createClient(TestUtils.getLocalHost(), server.getPort());
String msg = "Hello, World!"; String msg = "Hello, World!";
byte[] resp = client.sendRpcSync(msg.getBytes(), 1000); byte[] resp = client.sendRpcSync(msg.getBytes(), TIMEOUT_MS);
assertEquals(msg, new String(resp)); // our rpc handler should just return the given msg assertEquals(msg, new String(resp)); // our rpc handler should just return the given msg
} }
...@@ -131,7 +136,7 @@ public class SaslIntegrationSuite { ...@@ -131,7 +136,7 @@ public class SaslIntegrationSuite {
TransportClient client = clientFactory.createClient(TestUtils.getLocalHost(), server.getPort()); TransportClient client = clientFactory.createClient(TestUtils.getLocalHost(), server.getPort());
try { try {
client.sendRpcSync(new byte[13], 1000); client.sendRpcSync(new byte[13], TIMEOUT_MS);
fail("Should have failed"); fail("Should have failed");
} catch (Exception e) { } catch (Exception e) {
assertTrue(e.getMessage(), e.getMessage().contains("Expected SaslMessage")); assertTrue(e.getMessage(), e.getMessage().contains("Expected SaslMessage"));
...@@ -139,7 +144,7 @@ public class SaslIntegrationSuite { ...@@ -139,7 +144,7 @@ public class SaslIntegrationSuite {
try { try {
// Guessing the right tag byte doesn't magically get you in... // Guessing the right tag byte doesn't magically get you in...
client.sendRpcSync(new byte[] { (byte) 0xEA }, 1000); client.sendRpcSync(new byte[] { (byte) 0xEA }, TIMEOUT_MS);
fail("Should have failed"); fail("Should have failed");
} catch (Exception e) { } catch (Exception e) {
assertTrue(e.getMessage(), e.getMessage().contains("java.lang.IndexOutOfBoundsException")); assertTrue(e.getMessage(), e.getMessage().contains("java.lang.IndexOutOfBoundsException"));
...@@ -217,12 +222,12 @@ public class SaslIntegrationSuite { ...@@ -217,12 +222,12 @@ public class SaslIntegrationSuite {
new String[] { System.getProperty("java.io.tmpdir") }, 1, new String[] { System.getProperty("java.io.tmpdir") }, 1,
"org.apache.spark.shuffle.sort.SortShuffleManager"); "org.apache.spark.shuffle.sort.SortShuffleManager");
RegisterExecutor regmsg = new RegisterExecutor("app-1", "0", executorInfo); RegisterExecutor regmsg = new RegisterExecutor("app-1", "0", executorInfo);
client1.sendRpcSync(regmsg.toByteArray(), 10000); client1.sendRpcSync(regmsg.toByteArray(), TIMEOUT_MS);
// Make a successful request to fetch blocks, which creates a new stream. But do not actually // Make a successful request to fetch blocks, which creates a new stream. But do not actually
// fetch any blocks, to keep the stream open. // fetch any blocks, to keep the stream open.
OpenBlocks openMessage = new OpenBlocks("app-1", "0", blockIds); OpenBlocks openMessage = new OpenBlocks("app-1", "0", blockIds);
byte[] response = client1.sendRpcSync(openMessage.toByteArray(), 10000); byte[] response = client1.sendRpcSync(openMessage.toByteArray(), TIMEOUT_MS);
StreamHandle stream = (StreamHandle) BlockTransferMessage.Decoder.fromByteArray(response); StreamHandle stream = (StreamHandle) BlockTransferMessage.Decoder.fromByteArray(response);
long streamId = stream.streamId; long streamId = stream.streamId;
......
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