Skip to content

Conversation

olsajiri
Copy link
Contributor

When we hit error (flake?) in TestControllerSuite we panic like below:

  panic.go:262: test panicked: runtime error: invalid memory address or nil pointer dereference
      goroutine 69 [running]:
      runtime/debug.Stack()
         /opt/hostedtoolcache/go/1.25.1/x64/src/runtime/debug/stack.go:26 +0x5e
      github.com/stretchr/testify/suite.failOnPanic(0xc000670700, {0x1bd1700, 0x314f770})
         /home/runner/work/tetragon/tetragon/vendor/github.com/stretchr/testify/suite/suite.go:89 +0x37
      github.com/stretchr/testify/suite.Run.func1.1()
         /home/runner/work/tetragon/tetragon/vendor/github.com/stretchr/testify/suite/suite.go:184 +0x25f
      panic({0x1bd1700?, 0x314f770?})
         /opt/hostedtoolcache/go/1.25.1/x64/src/runtime/panic.go:783 +0x132
      github.com/cilium/tetragon/pkg/manager.(*ManagerTestSuite).TestFindContainer(0xc0004a6e10)
         /home/runner/work/tetragon/tetragon/pkg/manager/manager_integration_test.go:108 +0x2b9
      reflect.Value.call({0xc0000b0e80?, 0xc00008acb8?, 0x1931bc5?}, {0x1e8196e, 0x4}, {0xc000096f28, 0x1, 0x1be6680?})
         /opt/hostedtoolcache/go/1.25.1/x64/src/reflect/value.go:581 +0xcc6
      reflect.Value.Call({0xc0000b0e80?, 0xc00008acb8?, 0x2b90fb8?}, {0xc000096f28?, 0x1cf6680?, 0x218f401?})
         /opt/hostedtoolcache/go/1.25.1/x64/src/reflect/value.go:365 +0xb9
      github.com/stretchr/testify/suite.Run.func1(0xc000670700)
         /home/runner/work/tetragon/tetragon/vendor/github.com/stretchr/testify/suite/suite.go:196 +0x425
      testing.tRunner(0xc000670700, 0xc00014e120)
         /opt/hostedtoolcache/go/1.25.1/x64/src/testing/testing.go:1934 +0xea
      created by testing.(*T).Run in goroutine 28
         /opt/hostedtoolcache/go/1.25.1/x64/src/testing/testing.go:1997 +0x465

Make sure we do not panic in case suite.manager.FindContainer fails.

Fixes

Description

Changelog

Copy link

netlify bot commented Sep 14, 2025

Deploy Preview for tetragon ready!

Name Link
🔨 Latest commit 57d8ef1
🔍 Latest deploy log https://app.netlify.com/projects/tetragon/deploys/68c8831b05ddb20008168047
😎 Deploy Preview https://deploy-preview-4110--tetragon.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@olsajiri olsajiri added the release-note/minor This PR introduces a minor user-visible change label Sep 14, 2025
When we hit error (flake?) in TestControllerSuite we panic like below:

  panic.go:262: test panicked: runtime error: invalid memory address or nil pointer dereference
      goroutine 69 [running]:
      runtime/debug.Stack()
         /opt/hostedtoolcache/go/1.25.1/x64/src/runtime/debug/stack.go:26 +0x5e
      github.com/stretchr/testify/suite.failOnPanic(0xc000670700, {0x1bd1700, 0x314f770})
         /home/runner/work/tetragon/tetragon/vendor/github.com/stretchr/testify/suite/suite.go:89 +0x37
      github.com/stretchr/testify/suite.Run.func1.1()
         /home/runner/work/tetragon/tetragon/vendor/github.com/stretchr/testify/suite/suite.go:184 +0x25f
      panic({0x1bd1700?, 0x314f770?})
         /opt/hostedtoolcache/go/1.25.1/x64/src/runtime/panic.go:783 +0x132
      github.com/cilium/tetragon/pkg/manager.(*ManagerTestSuite).TestFindContainer(0xc0004a6e10)
         /home/runner/work/tetragon/tetragon/pkg/manager/manager_integration_test.go:108 +0x2b9
      reflect.Value.call({0xc0000b0e80?, 0xc00008acb8?, 0x1931bc5?}, {0x1e8196e, 0x4}, {0xc000096f28, 0x1, 0x1be6680?})
         /opt/hostedtoolcache/go/1.25.1/x64/src/reflect/value.go:581 +0xcc6
      reflect.Value.Call({0xc0000b0e80?, 0xc00008acb8?, 0x2b90fb8?}, {0xc000096f28?, 0x1cf6680?, 0x218f401?})
         /opt/hostedtoolcache/go/1.25.1/x64/src/reflect/value.go:365 +0xb9
      github.com/stretchr/testify/suite.Run.func1(0xc000670700)
         /home/runner/work/tetragon/tetragon/vendor/github.com/stretchr/testify/suite/suite.go:196 +0x425
      testing.tRunner(0xc000670700, 0xc00014e120)
         /opt/hostedtoolcache/go/1.25.1/x64/src/testing/testing.go:1934 +0xea
      created by testing.(*T).Run in goroutine 28
         /opt/hostedtoolcache/go/1.25.1/x64/src/testing/testing.go:1997 +0x465

Make sure we do not panic in case suite.manager.FindContainer fails.

Signed-off-by: Jiri Olsa <[email protected]>
@olsajiri olsajiri marked this pull request as ready for review September 18, 2025 12:45
@olsajiri olsajiri requested a review from a team as a code owner September 18, 2025 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/minor This PR introduces a minor user-visible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant