Skip to content

Commit

Permalink
Merge pull request #906 from noobwei/main
Browse files Browse the repository at this point in the history
E2E Enhancement Draft
  • Loading branch information
kmesh-bot authored Oct 24, 2024
2 parents 06ab5f4 + 2541f18 commit a4ca182
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/e2e/baseline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import (
"istio.io/istio/pkg/test/framework/components/echo"
"istio.io/istio/pkg/test/framework/components/echo/check"
"istio.io/istio/pkg/test/framework/components/echo/common/ports"
"istio.io/istio/pkg/test/framework/components/echo/util/traffic"
"istio.io/istio/pkg/test/framework/components/prometheus"
testKube "istio.io/istio/pkg/test/kube"
"istio.io/istio/pkg/test/shell"
Expand Down Expand Up @@ -907,3 +908,36 @@ func PromDiff(t test.Failer, prom prometheus.Instance, cluster cluster.Cluster,
t.Fatalf("PromDiff expects Vector, got %v", v.Type())
}
}

func TestServiceRestart(t *testing.T) {
const callInterval = 100 * time.Millisecond
successThreshold := 1.0
framework.NewTest(t).Run(func(t framework.TestContext) {
for _, dst := range apps.EnrolledToKmesh {
generators := []traffic.Generator{}
mkGen := func(src echo.Caller) {
g := traffic.NewGenerator(t, traffic.Config{
Source: src,
Options: echo.CallOptions{
To: dst,
Count: 1,
Check: check.OK(),
HTTP: echo.HTTP{Path: "/?delay=10ms"},
Port: echo.Port{
Name: "http",
},
},
Interval: callInterval,
}).Start()
generators = append(generators, g)
}
mkGen(apps.ServiceWithWaypointAtServiceGranularity[0])
if err := dst.Restart(); err != nil {
t.Fatal(err)
}
for _, gen := range generators {
gen.Stop().CheckSuccessRate(t, successThreshold)
}
}
})
}
4 changes: 4 additions & 0 deletions test/e2e/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@ while (( "$#" )); do
CLEANUP_REGISTRY=true
shift
;;
--skip-cleanup-apps)
PARAMS+=("--istio.test.noCleanup")
shift
;;
*)
PARAMS+=("$1")
shift
Expand Down

0 comments on commit a4ca182

Please sign in to comment.