mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
Fix race in tests (modifying already started server config) (#8227)
This commit is contained in:
parent
06a9e886a1
commit
03096ee546
@ -253,12 +253,13 @@ func RunServerForTestsWithDS(t *testing.T, ds fleet.Datastore, opts ...*TestServ
|
||||
}
|
||||
limitStore, _ := memstore.New(0)
|
||||
r := MakeHandler(svc, cfg, logger, limitStore, WithLoginRateLimit(throttled.PerMin(100)))
|
||||
server := httptest.NewServer(r)
|
||||
server := httptest.NewUnstartedServer(r)
|
||||
// Set the same ReadTimeout as the actual server
|
||||
server.Config.ReadTimeout = 25 * time.Second
|
||||
server.Start()
|
||||
t.Cleanup(func() {
|
||||
server.Close()
|
||||
})
|
||||
// Set the same ReadTimeout as the actual server
|
||||
server.Config.ReadTimeout = 25 * time.Second
|
||||
return users, server
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user