mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
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:
@ -47,6 +47,7 @@ type Options struct {
|
||||
CacheDir string
|
||||
|
||||
AgentConnectionUpdateFrequency time.Duration
|
||||
AgentInactiveDisconnectTimeout time.Duration
|
||||
// APIRateLimit is the minutely throughput rate limit per user or ip.
|
||||
// Setting a rate limit <0 will disable the rate limiter across the entire
|
||||
// app. Specific routes may have their own limiters.
|
||||
@ -69,6 +70,10 @@ func New(options *Options) *API {
|
||||
if options.AgentConnectionUpdateFrequency == 0 {
|
||||
options.AgentConnectionUpdateFrequency = 3 * time.Second
|
||||
}
|
||||
if options.AgentInactiveDisconnectTimeout == 0 {
|
||||
// Multiply the update by two to allow for some lag-time.
|
||||
options.AgentInactiveDisconnectTimeout = options.AgentConnectionUpdateFrequency * 2
|
||||
}
|
||||
if options.APIRateLimit == 0 {
|
||||
options.APIRateLimit = 512
|
||||
}
|
||||
|
Reference in New Issue
Block a user