Browse Source

etcdmain: test wrong heartbeat-interval, election-timeout in TestConfigFileElectionTimeout

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
Gyu-Ho Lee 8 years ago
parent
commit
c8277e1b02
1 changed files with 11 additions and 0 deletions
  1. 11 0
      etcdmain/config_test.go

+ 11 - 0
etcdmain/config_test.go

@@ -460,8 +460,19 @@ func TestConfigFileElectionTimeout(t *testing.T) {
 		},
 		{
 			ElectionMs: 60000,
+			TickMs:     10000,
 			errStr:     "is too long, and should be set less than",
 		},
+		{
+			ElectionMs: 100,
+			TickMs:     0,
+			errStr:     "--heartbeat-interval must be >0 (set to 0ms)",
+		},
+		{
+			ElectionMs: 0,
+			TickMs:     100,
+			errStr:     "--election-timeout must be >0 (set to 0ms)",
+		},
 	}
 
 	for i, tt := range tests {