Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/mail: DateParsing* tests failing with timezone match MDT (Idaho) after 3ef8562c9c2c7 #43354

Closed
ksshannon opened this issue Dec 23, 2020 · 2 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Milestone

Comments

@ksshannon
Copy link
Contributor

What version of Go are you using (go version)?

$ go version
go version devel +b116404444 Wed Dec 23 17:31:18 2020 +0000 linux/amd64

Does this issue reproduce with the latest release?

No, go1.15.x is okay

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/kyle/.cache/go-build"
GOENV="/home/kyle/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/kyle/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/kyle/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/kyle/src/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/kyle/src/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="devel +b116404444 Wed Dec 23 17:31:18 2020 +0000"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/kyle/src/go/src/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3744747422=/tmp/go-build -gno-record-gcc-switches"
GOROOT/bin/go version: go version devel +b116404444 Wed Dec 23 17:31:18 2020 +0000 linux/amd64
GOROOT/bin/go tool compile -V: compile version devel +b116404444 Wed Dec 23 17:31:18 2020 +0000
uname -sr: Linux 5.4.0-58-generic
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.5 LTS
Release:	18.04
Codename:	bionic
/lib/x86_64-linux-gnu/libc.so.6: GNU C Library (Ubuntu GLIBC 2.27-3ubuntu1.4) stable release version 2.27.
gdb --version: GNU gdb (Ubuntu 8.1.1-0ubuntu1) 8.1.1

What did you do?

$ cd src/net/mail
$ % go test -run DateParsing

What did you expect to see?

$ go test -run DateParsing
PASS
ok  	net/mail	0.008s

What did you see instead?

$ go test -run DateParsing
--- FAIL: TestDateParsing (0.00s)
    message_test.go:126: Header(Date: Thu, 20 Nov 1997 09:55:06 MDT (MDT)).Date() = 1997-11-20 08:55:06 -0700 MST, want 1997-11-20 09:55:06 +0000 MDT
    message_test.go:133: ParseDate(Thu, 20 Nov 1997 09:55:06 MDT (MDT)) = 1997-11-20 08:55:06 -0700 MST, want 1997-11-20 09:55:06 +0000 MDT
--- FAIL: TestDateParsingCFWS (0.00s)
    message_test.go:297: Header(Date: Fri, 21 Nov 1997 09:55:06 MDT (MDT)).Date() = 1997-11-21 08:55:06 -0700 MST, want 1997-11-21 09:55:06 +0000 MDT
    message_test.go:311: ParseDate(Fri, 21 Nov 1997 09:55:06 MDT (MDT)) = 1997-11-21 08:55:06 -0700 MST, want 1997-11-21 09:55:06 +0000 MDT
FAIL
exit status 1
FAIL	net/mail	0.008s

Note that if I change timezones, the tests pass:

$ TZ=America/Los_Angeles go test -run DateParsing
PASS
ok  	net/mail	0.008s

I am in America/Boise or MST:

$ cat /etc/timezone                  
America/Boise

bisect points to: https://go-review.googlesource.com/c/go/+/235200 and 3ef8562. I didn't look into it in detail though.

@ksshannon ksshannon changed the title net/mail: DateParsing* failing after 3ef8562c9c2c7f6897572b05b70ac936a99fd043 net/mail: DateParsing* tests failing after 3ef8562c9c2c7f6897572b05b70ac936a99fd043 Dec 23, 2020
@ianlancetaylor ianlancetaylor added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker labels Dec 23, 2020
@ianlancetaylor ianlancetaylor added this to the Go1.16 milestone Dec 23, 2020
@ianlancetaylor ianlancetaylor self-assigned this Dec 23, 2020
@gopherbot
Copy link

Change https://golang.org/cl/280072 mentions this issue: net/mail: don't use MDT in test

@odeke-em
Copy link
Member

Thank you for this report @ksshannon, and thanks @ianlancetaylor for the diagnosis and fix!

@odeke-em odeke-em changed the title net/mail: DateParsing* tests failing after 3ef8562c9c2c7f6897572b05b70ac936a99fd043 net/mail: DateParsing* tests failing with timezone match MDT (Idaho) after 3ef8562c9c2c7 Dec 25, 2020
@golang golang locked and limited conversation to collaborators Dec 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Projects
None yet
Development

No branches or pull requests

4 participants