fix(scaletest): fix flake in Test_Runner/Cleanup (#10252)

* fix(scaletest/createworkspaces): address flake in Test_Runner/CleanupPendingBuild

* fix(scaletest): pass io.Writer to Cleanup()

* add some extra logs to workspacebuild cleanup

* fixup! fix(scaletest): pass io.Writer to Cleanup()

* remove race

* fmt

* address PR comments
This commit is contained in:
Cian Johnston
2023-10-16 12:37:12 +01:00
committed by GitHub
parent 1be24dcb5c
commit dd86100f33
10 changed files with 61 additions and 32 deletions

View File

@ -28,7 +28,7 @@ type Runnable interface {
type Cleanable interface {
Runnable
// Cleanup should clean up any lingering resources from the test.
Cleanup(ctx context.Context, id string) error
Cleanup(ctx context.Context, id string, logs io.Writer) error
}
// AddRun creates a new *TestRun with the given name, ID and Runnable, adds it
@ -131,7 +131,7 @@ func (r *TestRun) Cleanup(ctx context.Context) (err error) {
}
}()
err = c.Cleanup(ctx, r.id)
err = c.Cleanup(ctx, r.id, r.logs)
//nolint:revive // we use named returns because we mutate it in a defer
return
}