Skip to content
This repository was archived by the owner on Mar 1, 2026. It is now read-only.

Commit 056a2df

Browse files
committed
Bug#34824457 logs missing on unclean process exit
If the router's integration tests fail with a unexpected exit-code, they should dump logs on failure, but instead no logs are dumped. That is caused by: 1. if the test failed, dump logs 2. check for clean exit. That works as expected for normal-test failures, but not if the monitored executable crashes after the test itself passed. Change ------ - flip the order: first, check for clean exit, then dump logs on failure. - removed not-needed .dump_logs() Change-Id: Iaa0cc56e64446444df789008a98d7c8e62e4e607
1 parent 739bcdc commit 056a2df

2 files changed

Lines changed: 5 additions & 12 deletions

File tree

‎router/tests/helpers/procs.h‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,20 @@ class Procs : public ProcessManager {
5050
* shutdown and stop monitoring of processes.
5151
*/
5252
void clear() {
53+
shutdown_all();
54+
ensure_clean_exit();
55+
5356
if (::testing::Test::HasFatalFailure() || dump_logs_) {
5457
dump_all();
5558
}
5659

60+
// it will call shutdown again ...
5761
ProcessManager::clear();
5862
}
5963

6064
void shutdown_all() { ProcessManager::shutdown_all(); }
6165

62-
~Procs() override {
63-
shutdown_all();
64-
ensure_clean_exit();
65-
66-
if (::testing::Test::HasFatalFailure() || dump_logs_) {
67-
dump_all();
68-
}
69-
}
66+
~Procs() override { clear(); }
7067

7168
void dump_logs() { dump_logs_ = true; }
7269

‎router/tests/integration/test_routing_sharing_restart.cc‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,10 +1225,6 @@ class ShareConnectionTestWithRestartedServer
12251225
void TearDown() override {
12261226
for (auto &inter : intermediate_routers_) {
12271227
if (!inter->is_running()) {
1228-
if (::testing::Test::HasFatalFailure()) {
1229-
inter->process_manager().dump_logs();
1230-
}
1231-
12321228
inter->process_manager().clear();
12331229
}
12341230
}

0 commit comments

Comments
 (0)