-
Notifications
You must be signed in to change notification settings - Fork 880
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
Exit test after timeout #7118
base: main
Are you sure you want to change the base?
Exit test after timeout #7118
Conversation
27b09d5
to
8a83088
Compare
rawStack := append(debug.Stack(), '\n', '\n') | ||
_, _, err := stack.ScanSnapshot(bytes.NewReader(rawStack), os.Stdout, stack.DefaultOpts()) | ||
if err != nil { | ||
t.Logf("failed to parse stack trace: %v", err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This output is a bit more readable than Go's default output.
- name: Highlight test timeout | ||
if: ${{ steps.test_run.outcome == 'failure' && steps.test_run.outputs.exit_code == 124 }} | ||
run: | | ||
echo "::error::Test Test timed out" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example:
TODO
87fa3f8
to
d6696c9
Compare
@@ -244,10 +247,21 @@ func (s *FunctionalTestBase) SetupSuiteWithCluster(clusterConfigFile string, opt | |||
func (s *FunctionalTestBase) SetupTest() { | |||
s.checkTestShard() | |||
s.initAssertions() | |||
if s.testTimeout == nil { | |||
s.testTimeout = newTestTimeout(s.T(), 30*time.Second*debug.TimeoutMultiplier) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't be in SetupSuite
as the SDK functional test suite overrides that.
d6696c9
to
d54bca9
Compare
What changed?
Added per-test timeouts.
Unfortunately there's no way to stop a particular Goroutine from the outside. That's why
os.Exit
- the nuclear option - is really the only choice IMO.Why?
Go only allows to set a timeout on the entire test run. But sometimes a single test is stuck and never going to complete. But you still have to wait for the very long timeout.
With this, at least it will fail fast.
How did you test it?
Potential risks
It could prematurely abort slower (non-stuck) tests - and require more tweaking of the timeouts for these. That could be annoying.
Documentation
Is hotfix candidate?