Skip to content

Test failed on different time zone. #3181

@kvii

Description

@kvii

What happened:

Test failed. Logs like below:

go test -run ^TestEncodeValues$ github.com/go-kratos/kratos/v2/encoding/form

--- FAIL: TestEncodeValues (0.00s)
    /Users/kvii/workspace/github.com/kvii/kratos/encoding/form/proto_encode_test.go:49: want: a=19...&timestamp=1970-01-01T00%3A00%3A20.000000002Z..., got: a=19...&timestamp=1970-01-01T08%3A00%3A20.000000002Z...
FAIL
FAIL	github.com/go-kratos/kratos/v2/encoding/form	1.340s
FAIL

Note that timestamps "1970-01-01T00" and "1970-01-01T08" are different.

What you expected to happen:

Test passed.

How to reproduce it (as minimally and precisely as possible):

go test -run ^TestEncodeValues$ github.com/go-kratos/kratos/v2/encoding/form.

Anything else we need to know?:

I'll fix it soon.

Environment:

  • Kratos version (use kratos -v): v2.7.2
  • Go version (use go version): go1.21.6 darwin/arm64
  • OS (e.g: cat /etc/os-release): Mac OS Sonoma 14.3
  • Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions