test(agent/agentscripts): fix test flake in TestEnv (#12326)

This commit is contained in:
Mathias Fredriksson
2024-02-27 17:58:10 +00:00
committed by GitHub
parent cbaf1c65ef
commit 32691e67e6
+7 -1
View File
@@ -69,12 +69,18 @@ func TestEnv(t *testing.T) {
ctx := testutil.Context(t, testutil.WaitLong)
testutil.Go(t, func() {
done := testutil.Go(t, func() {
err := runner.Execute(ctx, func(script codersdk.WorkspaceAgentScript) bool {
return true
})
assert.NoError(t, err)
})
defer func() {
select {
case <-ctx.Done():
case <-done:
}
}()
var log []agentsdk.Log
for {