Skip to content

Commit bea9b91

Browse files
dmitshurgopherbot
authored andcommitted
time: accept "+01" in TestLoadFixed on OpenBSD
This stops the test from failing with a known failure mode, and creates time to look into what the next steps should be, if any. For #69840. Change-Id: I060903d256ed65c5dfcd70ae76eb361cab63186f Cq-Include-Trybots: luci.golang.try:gotip-openbsd-amd64 Reviewed-on: https://go-review.googlesource.com/c/go/+/625197 Auto-Submit: Dmitri Shuralyov <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Eric Grosse <[email protected]>
1 parent 5f88755 commit bea9b91

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/time/time_test.go

+10-4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"math/rand"
1515
"os"
1616
"runtime"
17+
"slices"
1718
"strings"
1819
"sync"
1920
"testing"
@@ -1124,10 +1125,15 @@ func TestLoadFixed(t *testing.T) {
11241125
// So GMT+1 corresponds to -3600 in the Go zone, not +3600.
11251126
name, offset := Now().In(loc).Zone()
11261127
// The zone abbreviation is "-01" since tzdata-2016g, and "GMT+1"
1127-
// on earlier versions; we accept both. (Issue #17276).
1128-
if !(name == "GMT+1" || name == "-01") || offset != -1*60*60 {
1129-
t.Errorf("Now().In(loc).Zone() = %q, %d, want %q or %q, %d",
1130-
name, offset, "GMT+1", "-01", -1*60*60)
1128+
// on earlier versions; we accept both. (Issue 17276.)
1129+
wantName := []string{"GMT+1", "-01"}
1130+
// The zone abbreviation may be "+01" on OpenBSD. (Issue 69840.)
1131+
if runtime.GOOS == "openbsd" {
1132+
wantName = append(wantName, "+01")
1133+
}
1134+
if !slices.Contains(wantName, name) || offset != -1*60*60 {
1135+
t.Errorf("Now().In(loc).Zone() = %q, %d, want %q (one of), %d",
1136+
name, offset, wantName, -1*60*60)
11311137
}
11321138
}
11331139

0 commit comments

Comments
 (0)