Skip to content

Commit bd084c0

Browse files
committed
test(packetparser): fix high aggregation perf sampling assertion
1 parent 0cff9d0 commit bd084c0

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

pkg/plugin/packetparser/packetparser_ebpf_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ func TestHighAggregationPreviouslyObserved(t *testing.T) {
869869
"expected previously_observed_packets > 0 at HIGH aggregation")
870870
}
871871

872-
func TestHighAggregationSamplingSuppressesPerfBufferEvents(t *testing.T) {
872+
func TestHighAggregationSamplingSuppressesRepeatedPerfBufferEvents(t *testing.T) {
873873
objs, reader := compileAndLoadVariant(t, compileOpts{
874874
bypassFilter: 1,
875875
enableConntrack: false,
@@ -891,6 +891,12 @@ func TestHighAggregationSamplingSuppressesPerfBufferEvents(t *testing.T) {
891891
SrcIP: srcIP, DstIP: dstIP, SrcPort: 61000, DstPort: 80, ACK: true,
892892
})
893893
ebpftest.RunProgram(t, objs.EndpointIngressFilter, ackPkt)
894+
_, ok := ebpftest.ReadPerfEvent[packetparserPacket](t, reader, perfReaderTimeout)
895+
require.True(t, ok, "first ACK should still be reported when the connection has not emitted a prior sample")
896+
897+
// Once the ACK has established last_report for the connection, repeated
898+
// ACKs should stay suppressed while sampling is forced off.
899+
ebpftest.RunProgram(t, objs.EndpointIngressFilter, ackPkt)
894900
ebpftest.AssertNoPerfEvent(t, reader, 100*time.Millisecond)
895901
}
896902

0 commit comments

Comments
 (0)