Skip to content

Commit

Permalink
[release-branch.go1.23]time: accept "+01" in TestLoadFixed on OpenBSD
Browse files Browse the repository at this point in the history
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
Fixes #70239

Change-Id: I060903d256ed65c5dfcd70ae76eb361cab63186f
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]>
(cherry picked from commit bea9b91)
Reviewed-on: https://go-review.googlesource.com/c/go/+/627575
Reviewed-by: Dmitri Shuralyov <[email protected]>
TryBot-Bypass: Dmitri Shuralyov <[email protected]>
Auto-Submit: Ian Lance Taylor <[email protected]>
  • Loading branch information
dmitshur authored and gopherbot committed Nov 19, 2024
1 parent 3726f07 commit 777f43a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/time/time_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"math/rand"
"os"
"runtime"
"slices"
"strings"
"sync"
"testing"
Expand Down Expand Up @@ -1084,10 +1085,15 @@ func TestLoadFixed(t *testing.T) {
// So GMT+1 corresponds to -3600 in the Go zone, not +3600.
name, offset := Now().In(loc).Zone()
// The zone abbreviation is "-01" since tzdata-2016g, and "GMT+1"
// on earlier versions; we accept both. (Issue #17276).
if !(name == "GMT+1" || name == "-01") || offset != -1*60*60 {
t.Errorf("Now().In(loc).Zone() = %q, %d, want %q or %q, %d",
name, offset, "GMT+1", "-01", -1*60*60)
// on earlier versions; we accept both. (Issue 17276.)
wantName := []string{"GMT+1", "-01"}
// The zone abbreviation may be "+01" on OpenBSD. (Issue 69840.)
if runtime.GOOS == "openbsd" {
wantName = append(wantName, "+01")
}
if !slices.Contains(wantName, name) || offset != -1*60*60 {
t.Errorf("Now().In(loc).Zone() = %q, %d, want %q (one of), %d",
name, offset, wantName, -1*60*60)
}
}

Expand Down

0 comments on commit 777f43a

Please sign in to comment.