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

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy