Bail out of the integration tests if enable fails (#792)

A failure is much better then an infinite loop.
This commit is contained in:
Thad House
2017-12-04 20:24:26 -08:00
committed by Peter Johnson
parent 65cc85f68d
commit 64bfdc1a69
2 changed files with 17 additions and 1 deletions

View File

@@ -66,6 +66,12 @@ public abstract class AbstractComsSetup {
// Wait until the robot is enabled before starting the tests
int enableCounter = 0;
while (!DriverStation.getInstance().isEnabled()) {
if (enableCounter > 50) {
// Robot did not enable properly after 5 seconds.
// Force exit
TestBench.err().println("Failed to enable. Aborting");
System.exit(1);
}
try {
Thread.sleep(100);
} catch (InterruptedException ex) {