Skip to content

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

@ksshannon

Description

@ksshannon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.release-blocker

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions