From e2da486cd9fb1ca734802a64e862d17255e008bb Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Fri, 16 Oct 2015 17:53:43 -0700 Subject: [PATCH] Fix a racy test and increase the raft timeouts to mitigate other racy tests --- nomad/eval_endpoint_test.go | 4 +++- nomad/server_test.go | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/nomad/eval_endpoint_test.go b/nomad/eval_endpoint_test.go index ead6e6bfc..eb61ea3d0 100644 --- a/nomad/eval_endpoint_test.go +++ b/nomad/eval_endpoint_test.go @@ -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) diff --git a/nomad/server_test.go b/nomad/server_test.go index a2c114c81..b35d293cb 100644 --- a/nomad/server_test.go +++ b/nomad/server_test.go @@ -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