Skip to content

Commit

Permalink
[Grid] Fixing NodeRecoveryTest, checking that the node fetches the Grid
Browse files Browse the repository at this point in the history
config, and reports it properly, even after restarting.
  • Loading branch information
diemol committed Sep 4, 2018
1 parent 8e308c5 commit b613415
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions java/server/test/org/openqa/grid/e2e/node/NodeRecoveryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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()));
Expand Down

0 comments on commit b613415

Please sign in to comment.