[BUG] ray_test fails locally due to timezone issues
Flyte & Flytekit version
Flyte Master
Describe the bug
=== RUN TestGetEventInfo_LogTemplates/ray_job_start_time
ray_test.go:1248:
Error Trace: /Users/jasonparraga/code/flyte/flyteplugins/go/tasks/plugins/k8s/ray/ray_test.go:1248
Error: Not equal:
expected: []*core.TaskLog{(*core.TaskLog)(0x14000790600)}
actual : []*core.TaskLog{(*core.TaskLog)(0x14000790a20)}
Diff:
--- Expected
+++ Actual
@@ -13,3 +13,3 @@
unknownFields: ([]uint8) <nil>,
- Uri: (string) (len=43) "http://test/2024-01-01T12:00:00Z/1704110400",
+ Uri: (string) (len=48) "http://test/2024-01-01T04:00:00-08:00/1704110400",
Name: (string) (len=10) "ray job ID",
Test: TestGetEventInfo_LogTemplates/ray_job_start_time
Expected behavior
Unit tests should pass locally
Additional context to reproduce
No response
Screenshots
No response
Are you sure this issue hasn't been raised already?
- [x] Yes
Have you read the Code of Conduct?
- [x] Yes
This issue is caused by a mismatch in timezone handling between local and CI environments, leading to different timestamp formats in the test output. The test expects a UTC timestamp, but your local environment uses the system's timezone, resulting in a different string representation and test failure. The recommended fix is to force the test suite to run in UTC by setting time.Local = time.UTC in the test's TestMain function, as shown in the common_operator_test.go file and described in PR #4760.
Would you like more detail on how to implement this fix in your test file?
Sources:
This is an AI-generated response and your feedback is appreciated! Please leave a 👍 if this is helpful and 👎 if it is not.
Mention @runllm to ask follow-up questions. See runllm.com for more!