diff --git a/test/framework/fixtures/libgoalFixture.go b/test/framework/fixtures/libgoalFixture.go index f1a13111a0..d5140199da 100644 --- a/test/framework/fixtures/libgoalFixture.go +++ b/test/framework/fixtures/libgoalFixture.go @@ -144,20 +144,23 @@ func (f *LibGoalFixture) nodeExitWithError(nc *nodecontrol.NodeController, err e return } - defer func() { + debugLog := func() { f.t.Logf("Node at %s has terminated with an error: %v. Dumping logs...", nc.GetDataDir(), err) f.dumpLogs(filepath.Join(nc.GetDataDir(), "node.log")) - }() + } exitError, ok := err.(*exec.ExitError) if !ok { - require.NoError(f.t, err, "Node at %s has terminated with an error", nc.GetDataDir()) + debugLog() + require.NoError(f.t, err) return } ws := exitError.Sys().(syscall.WaitStatus) exitCode := ws.ExitStatus() - require.NoError(f.t, err, "Node at %s has terminated with error code %d", nc.GetDataDir(), exitCode) + f.t.Logf("Node at %s has terminated with error code %d (%v)", nc.GetDataDir(), exitCode, *exitError) + debugLog() + require.NoError(f.t, err) } func (f *LibGoalFixture) importRootKeys(lg *libgoal.Client, dataDir string) {