test(server): synchronize remaining startup watchdog log capture

TestStartupWatchdogFiresAndNamesLastPhase and TestStartupWatchdogStopIsIdempotentAndPreventsFire still poll a plain bytes.Buffer while the watchdog goroutine writes it through zerolog, so 'go test -race' reports the same read/write data race that 4d2ee8666c fixed only in service_health_test.go. Reuse the package-level syncBuffer so the poll and the watchdog write are serialized; drop the now-unused bytes import.

Change-source: pulse-maintainer
This commit is contained in:
pulse-triage[bot]
2026-09-21 09:41:55 +01:00
parent 4d2ee8666c
commit 3ac3171927
+2 -3
View File
@@ -1,7 +1,6 @@
package server
import (
"bytes"
"strings"
"testing"
"time"
@@ -27,7 +26,7 @@ func TestStartupPhaseMarkAndCurrent(t *testing.T) {
}
func TestStartupWatchdogFiresAndNamesLastPhase(t *testing.T) {
var buf bytes.Buffer
var buf syncBuffer
logger := zerolog.New(&buf)
phase := &startupPhase{}
@@ -54,7 +53,7 @@ func TestStartupWatchdogFiresAndNamesLastPhase(t *testing.T) {
}
func TestStartupWatchdogStopIsIdempotentAndPreventsFire(t *testing.T) {
var buf bytes.Buffer
var buf syncBuffer
logger := zerolog.New(&buf)
stop := startStartupWatchdog(logger, &startupPhase{}, 15*time.Millisecond)