diff --git a/cmd/consume/consume_test.go b/cmd/consume/consume_test.go index 11194936..b5a2075d 100644 --- a/cmd/consume/consume_test.go +++ b/cmd/consume/consume_test.go @@ -120,8 +120,8 @@ func TestConsumeFromTimestampIntegration(t *testing.T) { // test --from-timestamp with --to-timestamp with formatted dates kafkaCtl := testutil.CreateKafkaCtlCommand() - t1Formatted := time.UnixMilli(t1).Format("2006-01-02T15:04:05.000Z") - t2Formatted := time.UnixMilli(t2).Format("2006-01-02T15:04:05.000Z") + t1Formatted := time.UnixMilli(t1).UTC().Format("2006-01-02T15:04:05.000Z") + t2Formatted := time.UnixMilli(t2).UTC().Format("2006-01-02T15:04:05.000Z") if _, err := kafkaCtl.Execute("consume", topicName, "--from-timestamp", t1Formatted, "--to-timestamp", t2Formatted); err != nil { t.Fatalf("failed to execute command: %v", err) } diff --git a/cmd/reset/reset-consumer-group-offset_test.go b/cmd/reset/reset-consumer-group-offset_test.go index 77c902e4..a7d95bcf 100644 --- a/cmd/reset/reset-consumer-group-offset_test.go +++ b/cmd/reset/reset-consumer-group-offset_test.go @@ -145,7 +145,7 @@ func TestResetCGOToDatetimeIntegration(t *testing.T) { time.Sleep(1 * time.Millisecond) // need to have messaged produced at different milliseconds to have reproducible test t1 := time.Now() - t1Formatted := t1.Format("2006-01-02T15:04:05.000Z") + t1Formatted := t1.UTC().Format("2006-01-02T15:04:05.000Z") testutil.ProduceMessage(t, topicName, "test-key", "c", 0, 2) testutil.ProduceMessage(t, topicName, "test-key", "d", 0, 3)