Skip to content

Commit 3234143

Browse files
committed
execute async to ensure log processing
1 parent 7dbfc2b commit 3234143

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

agent/agentscripts/agentscripts_test.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"github.com/google/uuid"
1111
"github.com/prometheus/client_golang/prometheus"
1212
"github.com/spf13/afero"
13+
"github.com/stretchr/testify/assert"
1314
"github.com/stretchr/testify/require"
1415
"go.uber.org/goleak"
1516

@@ -75,9 +76,13 @@ func TestEnv(t *testing.T) {
7576

7677
ctx := testutil.Context(t, testutil.WaitLong)
7778

78-
require.NoError(t, runner.Execute(ctx, func(script codersdk.WorkspaceAgentScript) bool {
79-
return true
80-
}))
79+
testutil.Go(t, func() {
80+
err := runner.Execute(ctx, func(script codersdk.WorkspaceAgentScript) bool {
81+
return true
82+
})
83+
assert.NoError(t, err)
84+
})
85+
8186
var log []agentsdk.Log
8287
for {
8388
select {

0 commit comments

Comments
 (0)