Skip to content

testutils: write goroutine dump to file on SucceedsSoon timeout#164551

Open
aerfrei wants to merge 1 commit intocockroachdb:masterfrom
aerfrei:fix-164187-dump
Open

testutils: write goroutine dump to file on SucceedsSoon timeout#164551
aerfrei wants to merge 1 commit intocockroachdb:masterfrom
aerfrei:fix-164187-dump

Conversation

@aerfrei
Copy link
Contributor

@aerfrei aerfrei commented Feb 27, 2026

When a SucceedsSoon/SucceedsWithin retry loop times out, the failure message now includes the path to a goroutine dump file written alongside the test output. This helps diagnose what the system was doing instead of reaching the expected state.

The dump is written to a file (via datapathutils.DebuggableTempDir) of the form goroutine_dump_.txt.

Both SucceedsWithin (in pkg/testutils) and SQLRunner.succeedsWithin (in pkg/testutils/sqlutils) now use the same WriteGoroutineDump helper. The SQLRunner path previously used require.NoError which bypassed SucceedsWithin entirely; it now handles the error directly.

Informs: #164187

@blathers-crl
Copy link

blathers-crl bot commented Feb 27, 2026

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@trunk-io
Copy link
Contributor

trunk-io bot commented Feb 27, 2026

Merging to master in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

When a SucceedsSoon/SucceedsWithin retry loop times out, the failure
message now includes the path to a goroutine dump file written alongside
the test output. This helps diagnose what the system was doing instead
of reaching the expected state.

The dump is written to a file (via datapathutils.DebuggableTempDir)
of the form goroutine_dump_<random>.txt.

The SQLRunner path previously used require.NoError which bypassed
SucceedsWithin entirely; it now delegates to SucceedsWithin directly
via a small adapter type that bridges the Fataler/TestFataler interfaces.

Informs: cockroachdb#164187
@aerfrei aerfrei marked this pull request as ready for review February 27, 2026 22:04
@aerfrei aerfrei requested a review from a team as a code owner February 27, 2026 22:04
@aerfrei aerfrei requested review from jeffswenson and michae2 and removed request for a team February 27, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants