aboutsummaryrefslogtreecommitdiffstats
path: root/node-admin
diff options
context:
space:
mode:
authorgjoranv <gjoranv@gmail.com>2023-09-11 18:25:09 +0200
committergjoranv <gjoranv@gmail.com>2023-09-14 14:46:38 +0200
commit1ba250575ca96161e5d6b83d45daf94487f149e9 (patch)
tree71e14164b027f2746bd57f7c64a7d203ed774b0c /node-admin
parentc85b492b03b1503d78092245c5f2c96f0bc22711 (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.java11
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();
+ }
+
}