Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 44ddc9f

Browse files
authored
chore(agent/agentscripts): increase timeout in TestTimeout (#17293)
Fixes coder/internal#329 This was due to a race between the process starting and the timeout of the agent startup script executor. I'm taking the 'lazy' route here and increasing the timeout to 100ms. This does technically mean that this makes the test 100 times longer to execute. However, if it takes more than 100ms to run a `sleep infinity` command on our test runner, I think we have other issues.
1 parent b1f59aa commit 44ddc9f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

agent/agentscripts/agentscripts_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func TestTimeout(t *testing.T) {
108108
err := runner.Init([]codersdk.WorkspaceAgentScript{{
109109
LogSourceID: uuid.New(),
110110
Script: "sleep infinity",
111-
Timeout: time.Millisecond,
111+
Timeout: 100 * time.Millisecond,
112112
}}, aAPI.ScriptCompleted)
113113
require.NoError(t, err)
114114
require.ErrorIs(t, runner.Execute(context.Background(), agentscripts.ExecuteAllScripts), agentscripts.ErrTimeout)

0 commit comments

Comments
 (0)