fix: Elongate agent disconnect timeout in tests (#2687)

This will fix the flake seen here:
https://github.com/coder/coder/runs/7071719863?check_suite_focus=true
This commit is contained in:
Kyle Carberry
2022-06-27 10:06:51 -05:00
committed by GitHub
parent 4a2d29948e
commit 08f4b193e1
5 changed files with 20 additions and 12 deletions

View File

@ -152,6 +152,9 @@ func NewWithAPI(t *testing.T, options *Options) (*codersdk.Client, *coderd.API)
// We set the handler after server creation for the access URL.
coderAPI := coderd.New(&coderd.Options{
AgentConnectionUpdateFrequency: 150 * time.Millisecond,
// Force a long disconnection timeout to ensure
// agents are not marked as disconnected during slow tests.
AgentInactiveDisconnectTimeout: 5 * time.Second,
AccessURL: serverURL,
Logger: slogtest.Make(t, nil).Leveled(slog.LevelDebug),
Database: db,