[Grid] Fixing NodeRecoveryTest, checking that the node fetches the Grid
config, and reports it properly, even after restarting.
@@ -53,6 +53,7 @@ public void setup() throws Exception {
GridHubConfiguration config = new GridHubConfiguration();
config.host = "localhost";
config.port = PortProber.findFreePort();
+ config.timeout = ORIGINAL_TIMEOUT;
hub = new Hub(config);
hub.start();
@@ -61,7 +62,6 @@ public void setup() throws Exception {
// register a selenium 1 with a timeout of 3 sec
node.addBrowser(GridTestHelper.getDefaultBrowserCapability(), 1);
- node.setTimeout(ORIGINAL_TIMEOUT, 100);
node.setRemoteServer(new SeleniumServer(node.getConfiguration()));
node.startRemoteServer();
node.sendRegistrationRequest();
@@ -73,7 +73,8 @@ public void nodeServerCanStopAndRestart() throws Exception {
assertEquals(hub.getRegistry().getAllProxies().size(), 1);
for (RemoteProxy p : hub.getRegistry().getAllProxies()) {
- assertEquals(p.getTimeOut(), ORIGINAL_TIMEOUT * 1000);
+ // Nodes fetch timeout and browserTimeout from the hub and update their configs
+ assertEquals(ORIGINAL_TIMEOUT * 1000, p.getTimeOut());
}
DesiredCapabilities caps = GridTestHelper.getDefaultBrowserCapability();
@@ -82,9 +83,8 @@ public void nodeServerCanStopAndRestart() throws Exception {
// kill the node
node.stopRemoteServer();
-
- // change its config.
- node.setTimeout(NEW_TIMEOUT, 100);
+ // changing the hub's timeout, so the node takes it when it starts again
+ hub.getConfiguration().timeout = NEW_TIMEOUT;
// restart it
node.setRemoteServer(new SeleniumServer(node.getConfiguration()));
