mirror of
https://github.com/kemko/nomad.git
synced 2026-01-05 09:55:44 +03:00
Fix a racy test and increase the raft timeouts to mitigate other racy tests
This commit is contained in:
@@ -224,7 +224,9 @@ func TestEvalEndpoint_Update(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestEvalEndpoint_Create(t *testing.T) {
|
||||
s1 := testServer(t, nil)
|
||||
s1 := testServer(t, func(c *Config) {
|
||||
c.NumSchedulers = 0 // Prevent automatic dequeue
|
||||
})
|
||||
defer s1.Shutdown()
|
||||
codec := rpcClient(t, s1)
|
||||
|
||||
|
||||
@@ -44,9 +44,9 @@ func testServer(t *testing.T, cb func(*Config)) *Server {
|
||||
config.SerfConfig.MemberlistConfig.GossipInterval = 100 * time.Millisecond
|
||||
|
||||
// Tighten the Raft timing
|
||||
config.RaftConfig.LeaderLeaseTimeout = 20 * time.Millisecond
|
||||
config.RaftConfig.HeartbeatTimeout = 40 * time.Millisecond
|
||||
config.RaftConfig.ElectionTimeout = 40 * time.Millisecond
|
||||
config.RaftConfig.LeaderLeaseTimeout = 50 * time.Millisecond
|
||||
config.RaftConfig.HeartbeatTimeout = 50 * time.Millisecond
|
||||
config.RaftConfig.ElectionTimeout = 50 * time.Millisecond
|
||||
config.RaftTimeout = 500 * time.Millisecond
|
||||
|
||||
// Invoke the callback if any
|
||||
|
||||
Reference in New Issue
Block a user