[telemetry] internal/crashmonitor: fix TestViaStderr/trap

0 views
Skip to first unread message

Michael Stapelberg (Gerrit)

unread,
Oct 22, 2025, 10:57:43 AM (22 hours ago) Oct 22
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Alan Donovan, Go LUCI, golang-co...@googlegroups.com

Michael Stapelberg submitted the change

Change information

Commit message:
internal/crashmonitor: fix TestViaStderr/trap

I believe there’s a mistake in commit 06ef541f:

What used to be:

if got != want {
t.Errorf("got counter name <<%s>>, want <<%s>>", got, want)
}

became the following in TestViaStderr/panic:

if !wantRE.MatchString(got) {
t.Errorf("got counter name <<%s>>, want match for <<%s>>", got, wantRE)
}

…but the condition was negated in TestViaStderr/trap:

if wantRE.MatchString(got) {
t.Errorf("got counter name <<%s>>, want match for <<%s>>", got, wantRE)
}

This only went unnoticed because the crash stack line numbers are incorrect.

I noticed this when importing the x/telemetry package into google3,
where the package names are different and need an update.
Change-Id: I6327d174d09d0073c1e18e46618e0fd35e6b4e0c
Reviewed-by: Alan Donovan <adon...@google.com>
Files:
  • M internal/crashmonitor/monitor_test.go
Change size: XS
Delta: 1 file changed, 2 insertions(+), 2 deletions(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +2 by Alan Donovan
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: telemetry
Gerrit-Branch: master
Gerrit-Change-Id: I6327d174d09d0073c1e18e46618e0fd35e6b4e0c
Gerrit-Change-Number: 713780
Gerrit-PatchSet: 2
Gerrit-Owner: Michael Stapelberg <stape...@google.com>
Gerrit-Reviewer: Alan Donovan <adon...@google.com>
Gerrit-Reviewer: Michael Stapelberg <stape...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages