Skip to content

Commit

Permalink
Merge pull request #535 from nats-io/config_reload_cluster_tests
Browse files Browse the repository at this point in the history
Fixed some config reload cluster tests
  • Loading branch information
kozlovic authored Jul 11, 2017
2 parents f246c09 + 28d4420 commit 8a1ac81
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions server/reload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,8 @@ func TestConfigReloadEnableClusterAuthorization(t *testing.T) {
defer os.Remove(srvaConfig)
defer srva.Shutdown()

checkClusterFormed(t, srva, srvb)

srvaAddr := fmt.Sprintf("nats://%s:%d", srvaOpts.Host, srvaOpts.Port)
srvaConn, err := nats.Connect(srvaAddr)
if err != nil {
Expand Down Expand Up @@ -1234,7 +1236,7 @@ func TestConfigReloadEnableClusterAuthorization(t *testing.T) {
if err := srva.Reload(); err != nil {
t.Fatalf("Error reloading config: %v", err)
}
time.Sleep(10 * time.Millisecond)
checkClusterFormed(t, srva, srvb)

if numRoutes := srvb.NumRoutes(); numRoutes != 1 {
t.Fatalf("Expected 1 route, got %d", numRoutes)
Expand Down Expand Up @@ -1267,6 +1269,8 @@ func TestConfigReloadDisableClusterAuthorization(t *testing.T) {
defer os.Remove(srvaConfig)
defer srva.Shutdown()

checkClusterFormed(t, srva, srvb)

srvaAddr := fmt.Sprintf("nats://%s:%d", srvaOpts.Host, srvaOpts.Port)
srvaConn, err := nats.Connect(srvaAddr)
if err != nil {
Expand Down Expand Up @@ -1318,6 +1322,8 @@ func TestConfigReloadDisableClusterAuthorization(t *testing.T) {
t.Fatalf("Error reloading config: %v", err)
}

checkClusterFormed(t, srva, srvb)

if numRoutes := srvb.NumRoutes(); numRoutes != 1 {
t.Fatalf("Expected 1 route, got %d", numRoutes)
}
Expand Down Expand Up @@ -1349,6 +1355,8 @@ func TestConfigReloadClusterRoutes(t *testing.T) {
defer os.Remove(srvaConfig)
defer srva.Shutdown()

checkClusterFormed(t, srva, srvb)

srvcOpts, err := ProcessConfigFile("./configs/reload/srv_c_1.conf")
if err != nil {
t.Fatalf("Error processing config file: %v", err)
Expand Down Expand Up @@ -1412,7 +1420,7 @@ func TestConfigReloadClusterRoutes(t *testing.T) {
if err := srva.Reload(); err != nil {
t.Fatalf("Error reloading config: %v", err)
}
time.Sleep(20 * time.Millisecond)
checkClusterFormed(t, srva, srvc)

srvcAddr := fmt.Sprintf("nats://%s:%d", srvcOpts.Host, srvcOpts.Port)
srvcConn, err := nats.Connect(srvcAddr)
Expand Down

0 comments on commit 8a1ac81

Please sign in to comment.