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 20, 2024
1 parent 521ff28 commit dd9db6a
Show file tree
Hide file tree
Showing 7 changed files with 540 additions and 204 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ e2e-test/teardown:
.PHONY: e2e-test/teardown

e2e-test: e2e-test/teardown e2e-test/setup
ginkgo --output-dir="${PWD}/test/e2e/report" --json-report=report.json --junit-report=report.xml \
ginkgo -v --output-dir="${PWD}/test/e2e/report" --json-report=report.json --junit-report=report.xml \
${PWD}/test/e2e/pkg -- -consumer_name=$(shell cat ${PWD}/test/e2e/.consumer_name) \
-api-server=https://$(shell cat ${PWD}/test/e2e/.external_host_ip):30080 \
-grpc-server=$(shell cat ${PWD}/test/e2e/.external_host_ip):30090 \
Expand Down
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
4 changes: 2 additions & 2 deletions test/e2e/pkg/resources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ var _ = Describe("Resources", Ordered, Label("e2e-tests-resources"), func() {
}
}
return nil
}, 30*time.Second, 2*time.Second).ShouldNot(HaveOccurred())
}, 10*time.Second, 1*time.Second).ShouldNot(HaveOccurred())
})

It("delete the nginx deployment", func() {
Expand Down Expand Up @@ -199,7 +199,7 @@ var _ = Describe("Resources", Ordered, Label("e2e-tests-resources"), func() {
return fmt.Errorf("unexpected replicas, expected 1, got %d", *deploy.Spec.Replicas)
}
return nil
}, 30*time.Second, 2*time.Second).ShouldNot(HaveOccurred())
}, 10*time.Second, 1*time.Second).ShouldNot(HaveOccurred())
})

It("delete the nginx resource", func() {
Expand Down
Loading

0 comments on commit dd9db6a

Please sign in to comment.