diff options
author | Valerij Fredriksen <freva@users.noreply.github.com> | 2022-08-10 22:33:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-10 22:33:27 +0200 |
commit | 506ba8d26a65202f97022e4c4e7de5c2d9b2b40d (patch) | |
tree | 355ca267c966edffa3426499150bc7fb5ccbe00e /controller-server | |
parent | f243470365bf989efdc900d9def3c9f63b3593dc (diff) | |
parent | 56c94608613f8c454799a575ce483b61a66ba3bb (diff) |
Merge pull request #23626 from vespa-engine/jonmv/tests-cleanup
Jonmv/tests cleanup
Diffstat (limited to 'controller-server')
2 files changed, 11 insertions, 10 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java index 38d7b6d3a2b..ef3474e0c1e 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java @@ -656,10 +656,13 @@ public class InternalStepRunner implements StepRunner { controller.jobController().updateTestReport(id); return Optional.of(testFailure); case INCONCLUSIVE: - long sleepMinutes = Math.max(15, Math.min(120, Duration.between(deployment.get().at(), controller.clock().instant()).toMinutes() / 20)); - logger.log("Tests were inconclusive, and will run again in " + sleepMinutes + " minutes."); controller.jobController().updateTestReport(id); - controller.jobController().locked(id, run -> run.sleepingUntil(controller.clock().instant().plusSeconds(60 * sleepMinutes))); + controller.jobController().locked(id, run -> { + Instant nextAttemptAt = run.start(); + while ( ! nextAttemptAt.isAfter(controller.clock().instant())) nextAttemptAt = nextAttemptAt.plusSeconds(1800); + logger.log("Tests were inconclusive, and will run again at " + nextAttemptAt + "."); + return run.sleepingUntil(nextAttemptAt); + }); return Optional.of(reset); case ERROR: logger.log(INFO, "Tester failed running its tests!"); @@ -806,6 +809,7 @@ public class InternalStepRunner implements StepRunner { Consumer<String> updater = msg -> controller.notificationsDb().setNotification(source, Notification.Type.deployment, Notification.Level.error, msg); switch (run.status()) { case aborted: return; // wait and see how the next run goes. + case noTests: case running: case success: controller.notificationsDb().removeNotification(source, Notification.Type.deployment); @@ -822,10 +826,6 @@ public class InternalStepRunner implements StepRunner { case testFailure: updater.accept("one or more verification tests against the deployment failed. Please review test output in the deployment job log."); return; - case noTests: - controller.notificationsDb().setNotification(source, Notification.Type.deployment, Notification.Level.warning, - "no tests were found for this job type. Please review test output in the deployment job log."); - return; case error: case endpointCertificateTimeout: break; diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java index bf488198126..493c0945ecc 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java @@ -358,7 +358,8 @@ public class InternalStepRunnerTest { // Test sleeps for a while. tester.runner().run(); assertEquals(unfinished, tester.jobs().run(id).stepStatuses().get(Step.deployTester)); - tester.clock().advance(Duration.ofSeconds(899)); + Instant nextAttemptAt = tester.clock().instant().plusSeconds(1800); + tester.clock().advance(Duration.ofSeconds(1799)); tester.runner().run(); assertEquals(unfinished, tester.jobs().run(id).stepStatuses().get(Step.deployTester)); @@ -380,8 +381,8 @@ public class InternalStepRunnerTest { assertTestLogEntries(id, Step.endTests, new LogEntry(lastId1 + 1, Instant.ofEpochMilli(123), info, "Not enough data!"), - new LogEntry(lastId1 + 2, instant1, info, "Tests were inconclusive, and will run again in 15 minutes."), - new LogEntry(lastId1 + 15, instant1, info, "### Run will reset, and start over at " + instant1.plusSeconds(900).truncatedTo(SECONDS)), + new LogEntry(lastId1 + 2, instant1, info, "Tests were inconclusive, and will run again at " + nextAttemptAt + "."), + new LogEntry(lastId1 + 15, instant1, info, "### Run will reset, and start over at " + nextAttemptAt), new LogEntry(lastId1 + 16, instant1, info, ""), new LogEntry(lastId2 + 1, tester.clock().instant(), info, "Tests completed successfully.")); |