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

This commit is contained in:
Mathias Fredriksson 2024-02-27 19:58:10 +02:00 committed by GitHub
parent cbaf1c65ef
commit 32691e67e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 1 deletions

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 {