Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bpf/kmesh/workload/cgroup_skb.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "probe.h"
#include "config.h"

volatile __u32 enable_periodic_report = 0;
volatile __u32 enable_periodic_report = 1;

static inline bool is__periodic_report_enable()
{
Expand Down
59 changes: 57 additions & 2 deletions test/e2e/baseline_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//go:build integ
// +build integ

/*
* Copyright The Kmesh Authors.
Expand Down Expand Up @@ -955,6 +953,63 @@ func TestL4Telemetry(t *testing.T) {
})
}

func TestLongConnL4Telemetry(t *testing.T) {
framework.NewTest(t).Run(func(tc framework.TestContext) {
for _, src := range apps.EnrolledToKmesh {
for _, dst := range apps.EnrolledToKmesh {
tc.NewSubTestf("from %q to %q", src.Config().Service, dst.Config().Service).Run(func(stc framework.TestContext) {
localDst := dst
localSrc := src
opt := echo.CallOptions{
Port: echo.Port{Name: "http"},
Scheme: scheme.HTTP,
Count: 200,
Timeout: 1.5*60* time.Second,
Check: check.OK(),
HTTP: echo.HTTP{Path: "/?delay=3s", HTTP2: true},
To: localDst,
NewConnectionPerRequest: false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

go func() {
stc.Logf("sending continuous calls from %q to %q", deployName(localSrc), localDst.Config().Service)
start := time.Now()
localSrc.CallOrFail(stc, opt)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition this test wants to get metrics during the long connection process? However this function call is synchronous, and when it returns, the connection has been terminated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about running this function in another go routine ??

elapsed := time.Since(start)
stc.Logf("finished continuous calls from %q to %q in %v", deployName(localSrc), localDst.Config().Service, elapsed)
}()
query := buildL4Query(localSrc, localDst)
stc.Logf("prometheus query: %#v", query)
prevReqs := float64(0)
time.Sleep(5 * time.Second)
for range(2) {
err := retry.Until(func() bool {
reqs, err := prom.QuerySum(localSrc.Config().Cluster, query)
if err != nil {
stc.Logf("could not query for traffic from %q to %q: %v", deployName(localSrc), localDst.Config().Service, err)
return false
}

if reqs-prevReqs == 0.0 {
stc.Logf("found zero-valued sum for traffic from %q to %q: %v", deployName(localSrc), localDst.Config().Service, err)
return false
}
prevReqs = reqs
return true
}, retry.Timeout(15*time.Second), retry.BackoffDelay(1*time.Second))
if err != nil {
PromDiff(t, prom, localSrc.Config().Cluster, query)
stc.Errorf("could not validate L4 telemetry for %q to %q: %v", deployName(localSrc), localDst.Config().Service, err)
}
time.Sleep(15 * time.Second)
}
time.Sleep(1.5 * 60 * time.Second)
})
}
}
})
}

func buildL4Query(src, dst echo.Instance) prometheus.Query {
query := prometheus.Query{}

Expand Down
2 changes: 0 additions & 2 deletions test/e2e/gateway_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//go:build integ
// +build integ

// CODE Copied and modified from https://github.com/istio/istio
// more specifically: https://github.com/istio/istio/blob/master/pkg/test/framework/components/istio/ingress.go
Expand Down
2 changes: 0 additions & 2 deletions test/e2e/main_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//go:build integ
// +build integ

/*
* Copyright The Kmesh Authors.
Expand Down
2 changes: 0 additions & 2 deletions test/e2e/manage_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//go:build integ
// +build integ

/*
* Copyright The Kmesh Authors.
Expand Down
2 changes: 0 additions & 2 deletions test/e2e/restart_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//go:build integ
// +build integ

/*
* Copyright The Kmesh Authors.
Expand Down
Loading