summaryrefslogtreecommitdiffstats
path: root/clustercontroller-core
diff options
context:
space:
mode:
authorHarald Musum <musum@yahooinc.com>2022-08-31 11:51:35 +0200
committerHarald Musum <musum@yahooinc.com>2022-08-31 11:51:35 +0200
commitaaff62d168f0137735ddac37ce4a2f715e6411b5 (patch)
tree42c40977c5c7124938ac7d45933cb29f4c1ba94b /clustercontroller-core
parentbb620d0786395cac68fc7e8fda2af70428434b82 (diff)
Make sure to handle InterruptedException, otherwise tests might run forever
Diffstat (limited to 'clustercontroller-core')
-rw-r--r--clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetController.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetController.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetController.java
index a1e213fc1f9..712c86f1e15 100644
--- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetController.java
+++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetController.java
@@ -1139,6 +1139,7 @@ public class FleetController implements NodeListener, SlobrokListener, SystemSta
public NodeListener getNodeStateUpdateListener() { return FleetController.this; }
};
+ // For testing only
public void waitForCompleteCycle(Duration timeout) {
Instant endTime = Instant.now().plus(timeout);
synchronized (monitor) {
@@ -1151,7 +1152,11 @@ public class FleetController implements NodeListener, SlobrokListener, SystemSta
throw new IllegalStateException("Timed out waiting for cycle to complete. Not completed after " + timeout);
if ( !isRunning() )
throw new IllegalStateException("Fleetcontroller not running. Will never complete cycles");
- try{ monitor.wait(100); } catch (InterruptedException e) {}
+ try {
+ monitor.wait(100);
+ } catch (InterruptedException e) {
+ throw new RuntimeException(e);
+ }
}
} finally {
waitingForCycle = false;