mirror of
https://github.com/coder/coder.git
synced 2025-07-23 21:32:07 +00:00
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:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user