chore(agent/agentscripts): increase timeout in TestTimeout (#17293)

Fixes https://github.com/coder/internal/issues/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.
This commit is contained in:
Cian Johnston
2025-04-08 14:35:13 +00:00
committed by GitHub
parent b1f59aafc1
commit 44ddc9f654
+1 -1
View File
@@ -108,7 +108,7 @@ func TestTimeout(t *testing.T) {
err := runner.Init([]codersdk.WorkspaceAgentScript{{
LogSourceID: uuid.New(),
Script: "sleep infinity",
Timeout: time.Millisecond,
Timeout: 100 * time.Millisecond,
}}, aAPI.ScriptCompleted)
require.NoError(t, err)
require.ErrorIs(t, runner.Execute(context.Background(), agentscripts.ExecuteAllScripts), agentscripts.ErrTimeout)