Skip to content

Commit

Permalink
add resync test after reconnecting.
Browse files Browse the repository at this point in the history
Signed-off-by: morvencao <[email protected]>
  • Loading branch information
morvencao committed Jun 19, 2024
1 parent 521ff28 commit d48b2a6
Show file tree
Hide file tree
Showing 5 changed files with 546 additions and 196 deletions.
32 changes: 16 additions & 16 deletions test/e2e/pkg/grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ var _ = Describe("GRPC", Ordered, Label("e2e-tests-grpc"), func() {
return fmt.Errorf("resource not Available")
}

availableReplicas, ok := resourceStatus.ContentStatus["availableReplicas"]
replicas, ok := resourceStatus.ContentStatus["replicas"]
if !ok {
return fmt.Errorf("available replicas not found in content status")
return fmt.Errorf("replicas not found in content status")
}

if availableReplicas.(float64) != float64(1) {
return fmt.Errorf("unexpected available replicas, expected 1, got %d", availableReplicas)
if replicas.(float64) != float64(1) {
return fmt.Errorf("unexpected replicas, expected 1, got %d", replicas)
}

return nil
Expand Down Expand Up @@ -192,13 +192,13 @@ var _ = Describe("GRPC", Ordered, Label("e2e-tests-grpc"), func() {
return fmt.Errorf("resource not Available")
}

availableReplicas, ok := resourceStatus.ContentStatus["availableReplicas"]
replicas, ok := resourceStatus.ContentStatus["replicas"]
if !ok {
return fmt.Errorf("available replicas not found in content status")
return fmt.Errorf("replicas not found in content status")
}

if availableReplicas.(float64) != float64(2) {
return fmt.Errorf("unexpected available replicas, expected 2, got %d", availableReplicas)
if replicas.(float64) != float64(2) {
return fmt.Errorf("unexpected replicas, expected 2, got %d", replicas)
}

return nil
Expand Down Expand Up @@ -376,13 +376,13 @@ var _ = Describe("GRPC", Ordered, Label("e2e-tests-grpc"), func() {
return fmt.Errorf("failed to convert status feedback value to content status: %v", err)
}

availableReplicas, ok := contentStatus["availableReplicas"]
replicas, ok := contentStatus["replicas"]
if !ok {
return fmt.Errorf("available replicas not found in content status")
return fmt.Errorf("replicas not found in content status")
}

if availableReplicas.(float64) != float64(1) {
return fmt.Errorf("unexpected available replicas, expected 1, got %d", availableReplicas)
if replicas.(float64) != float64(1) {
return fmt.Errorf("unexpected replicas, expected 1, got %d", replicas)
}

return nil
Expand Down Expand Up @@ -456,13 +456,13 @@ var _ = Describe("GRPC", Ordered, Label("e2e-tests-grpc"), func() {
return fmt.Errorf("failed to convert status feedback value to content status: %v", err)
}

availableReplicas, ok := contentStatus["availableReplicas"]
replicas, ok := contentStatus["replicas"]
if !ok {
return fmt.Errorf("available replicas not found in content status")
return fmt.Errorf("replicas not found in content status")
}

if availableReplicas.(float64) != float64(2) {
return fmt.Errorf("unexpected available replicas, expected 2, got %d", availableReplicas)
if replicas.(float64) != float64(2) {
return fmt.Errorf("unexpected replicas, expected 2, got %d", replicas)
}

return nil
Expand Down
Loading

0 comments on commit d48b2a6

Please sign in to comment.