Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kola/harness.go: fix kola panics #2710

Merged
merged 1 commit into from
Feb 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions mantle/kola/harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -1276,17 +1276,23 @@ func makeNonExclusiveTest(bucket int, tests []*register.Test, flight platform.Fl
t := t
run := func(h *harness.H) {
testResults.add(h)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we comment here in the code why this newTC is needed?

// tcluster has a reference to the wrapper's harness
// We need a new TestCluster that has a reference to the
// subtest being ran
// This will allow timeout logic to work correctly when executing
// functions such as TestCluster.SSH, since these functions
// internally use harness.RunWithExecTimeoutCheck
newTC := cluster.TestCluster{
H: h,
Cluster: tcluster.Cluster,
}
// Install external test executable
if t.ExternalTest != "" {
setupExternalTest(h, t, tcluster)
setupExternalTest(h, t, newTC)
// Collect the journal logs after execution is finished
defer collectLogsExternalTest(h, t, tcluster)
defer collectLogsExternalTest(h, t, newTC)
}

newTC := cluster.TestCluster{
H: h,
Cluster: tcluster.Cluster,
}
t.Run(newTC)
}
// Each non-exclusive test is run as a subtest of this wrapper test
Expand Down