Fix a racy test and increase the raft timeouts to mitigate other racy tests

This commit is contained in:
Alex Dadgar
2015-10-16 17:53:43 -07:00
parent b6c826e85f
commit e2da486cd9
2 changed files with 6 additions and 4 deletions

View File

@@ -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)

View File

@@ -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