Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set trace log level for our flakyest tests #21595

Merged
merged 7 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions pkg/network/tracer/conntracker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const (
)

func TestConntrackers(t *testing.T) {
ebpftest.LogLevel(t, "debug")
t.Run("netlink", func(t *testing.T) {
runConntrackerTest(t, "netlink", setupNetlinkConntracker)
})
Expand Down
28 changes: 28 additions & 0 deletions pkg/network/tracer/offsetguess_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/DataDog/datadog-agent/pkg/network/tracer/offsetguess"
"github.com/DataDog/datadog-agent/pkg/process/statsd"
"github.com/DataDog/datadog-agent/pkg/util/kernel"
"github.com/DataDog/datadog-agent/pkg/util/log"
)

//go:generate $GOPATH/bin/include_headers pkg/network/ebpf/c/runtime/offsetguess-test.c pkg/ebpf/bytecode/build/runtime/offsetguess-test.c pkg/ebpf/c pkg/ebpf/c/protocols pkg/network/ebpf/c/runtime pkg/network/ebpf/c
Expand Down Expand Up @@ -126,6 +127,7 @@ func (o offsetT) String() string {
}

func TestOffsetGuess(t *testing.T) {
ebpftest.LogLevel(t, "debug")
ebpftest.TestBuildMode(t, ebpftest.RuntimeCompiled, "", testOffsetGuess)
}

Expand Down Expand Up @@ -158,56 +160,82 @@ func testOffsetGuess(t *testing.T) {
value := c.Value.(uint64)
switch c.Name {
case "offset_saddr":
log.Debug("offset_saddr: ", value)
akarpz marked this conversation as resolved.
Show resolved Hide resolved
consts[offsetSaddr] = value
case "offset_daddr":
log.Debug("offset_daddr: ", value)
consts[offsetDaddr] = value
case "offset_sport":
log.Debug("offset_sport: ", value)
consts[offsetSport] = value
case "offset_dport":
log.Debug("offset_dport: ", value)
consts[offsetDport] = value
case "offset_netns":
log.Debug("offset_netns: ", value)
consts[offsetNetns] = value
case "offset_ino":
log.Debug("offset_ino: ", value)
consts[offsetIno] = value
case "offset_family":
log.Debug("offset_family: ", value)
consts[offsetFamily] = value
case "offset_rtt":
log.Debug("offset_rtt: ", value)
consts[offsetRtt] = value
case "offset_rtt_var":
log.Debug("offset_rtt_var: ", value)
consts[offsetRttVar] = value
case "offset_daddr_ipv6":
log.Debug("offset_daddr_ipv6: ", value)
consts[offsetDaddrIpv6] = value
case "offset_saddr_fl4":
log.Debug("offset_saddr_fl4: ", value)
consts[offsetSaddrFl4] = value
case "offset_daddr_fl4":
log.Debug("offset_daddr_fl4: ", value)
consts[offsetDaddrFl4] = value
case "offset_sport_fl4":
log.Debug("offset_sport_fl4: ", value)
consts[offsetSportFl4] = value
case "offset_dport_fl4":
log.Debug("offset_dport_fl4: ", value)
consts[offsetDportFl4] = value
case "offset_saddr_fl6":
log.Debug("offset_saddr_fl6: ", value)
consts[offsetSaddrFl6] = value
case "offset_daddr_fl6":
log.Debug("offset_daddr_fl6: ", value)
consts[offsetDaddrFl6] = value
case "offset_sport_fl6":
log.Debug("offset_sport_fl6: ", value)
consts[offsetSportFl6] = value
case "offset_dport_fl6":
log.Debug("offset_dport_fl6: ", value)
consts[offsetDportFl6] = value
case "offset_socket_sk":
log.Debug("offset_socket_sk: ", value)
consts[offsetSocketSk] = value
case "offset_sk_buff_sock":
log.Debug("offset_sk_buff_sock: ", value)
consts[offsetSkBuffSock] = value
case "offset_sk_buff_transport_header":
log.Debug("offset_sk_buff_transport_header: ", value)
consts[offsetSkBuffTransportHeader] = value
case "offset_sk_buff_head":
log.Debug("offset_sk_buff_head: ", value)
consts[offsetSkBuffHead] = value
case "offset_ct_origin":
log.Debug("offset_ct_origin: ", value)
consts[offsetCtOrigin] = value
case "offset_ct_reply":
log.Debug("offset_ct_reply: ", value)
consts[offsetCtReply] = value
case "offset_ct_netns":
log.Debug("offset_ct_netns: ", value)
consts[offsetCtNetns] = value
case "offset_ct_ino":
log.Debug("offset_ct_ino: ", value)
consts[offsetCtIno] = value
}
}
Expand Down
4 changes: 4 additions & 0 deletions pkg/network/tracer/tracer_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import (
ddebpf "github.com/DataDog/datadog-agent/pkg/ebpf"
"github.com/DataDog/datadog-agent/pkg/ebpf/bytecode"
rc "github.com/DataDog/datadog-agent/pkg/ebpf/bytecode/runtime"
"github.com/DataDog/datadog-agent/pkg/ebpf/ebpftest"
"github.com/DataDog/datadog-agent/pkg/network"
"github.com/DataDog/datadog-agent/pkg/network/config"
"github.com/DataDog/datadog-agent/pkg/network/config/sysctl"
Expand Down Expand Up @@ -382,6 +383,7 @@ func (s *TracerSuite) TestConnectionExpirationRegression() {

func (s *TracerSuite) TestConntrackExpiration() {
t := s.T()
ebpftest.LogLevel(t, "debug")
netlinktestutil.SetupDNAT(t)
wg := sync.WaitGroup{}

Expand Down Expand Up @@ -2027,6 +2029,7 @@ func (s *TracerSuite) TestGetHelpersTelemetry() {
}

func TestEbpfConntrackerFallback(t *testing.T) {
ebpftest.LogLevel(t, "debug")
type testCase struct {
enableRuntimeCompiler bool
allowPrecompiledFallback bool
Expand Down Expand Up @@ -2102,6 +2105,7 @@ func TestEbpfConntrackerFallback(t *testing.T) {
}

func TestConntrackerFallback(t *testing.T) {
ebpftest.LogLevel(t, "debug")
cfg := testConfig()
cfg.EnableEbpfConntracker = false
cfg.AllowNetlinkConntrackerFallback = true
Expand Down