From 4c6c738d38faee5c0ea52df3b4d0d4362f7d3954 Mon Sep 17 00:00:00 2001 From: Stuart Geipel Date: Thu, 21 Nov 2024 11:30:52 -0800 Subject: [PATCH] fix expected vs actual ordering --- .../connection/ebpfless/tcp_processor_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/network/tracer/connection/ebpfless/tcp_processor_test.go b/pkg/network/tracer/connection/ebpfless/tcp_processor_test.go index 6d0d15658ebb0..ef96bb12f10f3 100644 --- a/pkg/network/tracer/connection/ebpfless/tcp_processor_test.go +++ b/pkg/network/tracer/connection/ebpfless/tcp_processor_test.go @@ -525,9 +525,9 @@ func TestConnRefusedSyn(t *testing.T) { f := newTcpTestFixture(t) f.runAgainstState(basicHandshake, expectedClientStates) - require.Equal(t, f.conn.TCPFailures, map[uint16]uint32{ + require.Equal(t, map[uint16]uint32{ uint16(syscall.ECONNREFUSED): 1, - }) + }, f.conn.TCPFailures) expectedStats := network.StatCounters{ SentBytes: 0, @@ -558,9 +558,9 @@ func TestConnRefusedSynAck(t *testing.T) { f := newTcpTestFixture(t) f.runAgainstState(basicHandshake, expectedClientStates) - require.Equal(t, f.conn.TCPFailures, map[uint16]uint32{ + require.Equal(t, map[uint16]uint32{ uint16(syscall.ECONNREFUSED): 1, - }) + }, f.conn.TCPFailures) expectedStats := network.StatCounters{ SentBytes: 0, @@ -595,9 +595,9 @@ func TestConnReset(t *testing.T) { f := newTcpTestFixture(t) f.runAgainstState(basicHandshake, expectedClientStates) - require.Equal(t, f.conn.TCPFailures, map[uint16]uint32{ + require.Equal(t, map[uint16]uint32{ uint16(syscall.ECONNRESET): 1, - }) + }, f.conn.TCPFailures) expectedStats := network.StatCounters{ SentBytes: 0, @@ -635,9 +635,9 @@ func TestRstRetransmit(t *testing.T) { f.runAgainstState(basicHandshake, expectedClientStates) // should count as a single failure - require.Equal(t, f.conn.TCPFailures, map[uint16]uint32{ + require.Equal(t, map[uint16]uint32{ uint16(syscall.ECONNRESET): 1, - }) + }, f.conn.TCPFailures) expectedStats := network.StatCounters{ SentBytes: 0,