diff options
author | gjoranv <gjoranv@gmail.com> | 2023-09-11 18:25:09 +0200 |
---|---|---|
committer | gjoranv <gjoranv@gmail.com> | 2023-09-11 18:25:56 +0200 |
commit | 7bfcb402e4eabc26ad9174f789e813435bbf8f0e (patch) | |
tree | 57a581762a10c3226d595b7e925cc8f49c5172ac /node-admin | |
parent | 1cd345950f80b53cf622982eb43be1726c24895e (diff) |
Output expected and actual command lines upon exception.
Diffstat (limited to 'node-admin')
-rw-r--r-- | node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/process/TestProcessFactory.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/process/TestProcessFactory.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/process/TestProcessFactory.java index 29f1ffef6f2..c87d3875d25 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/process/TestProcessFactory.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/process/TestProcessFactory.java @@ -63,7 +63,9 @@ public class TestProcessFactory implements ProcessFactory { int missingCommandIndex = spawnCommandLines.size(); throw new IllegalStateException("Command #" + missingCommandIndex + " never executed: " + - expectedSpawnCalls.get(missingCommandIndex).commandDescription); + expectedSpawnCalls.get(missingCommandIndex).commandDescription + + "\nExpected commands:\n" + getExpectedCommandLines() + + "\nActual commands:\n" + spawnCommandLines); } } @@ -101,4 +103,11 @@ public class TestProcessFactory implements ProcessFactory { return toReturn; } + + private List<String> getExpectedCommandLines() { + return expectedSpawnCalls.stream() + .map(spawnCall -> spawnCall.commandDescription) + .toList(); + } + } |