We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Please answer these questions before submitting your issue. Thanks!
The below test will fail:
func TestTimerStoreWithDST(t *testing.T) { store := testkit.CreateMockStore(t) tk := testkit.NewTestKit(t, store) dbName := "test" tblName := "timerstore" tk.MustExec("use test") tk.MustExec(tablestore.CreateTimerTableSQL(dbName, tblName)) tk.MustExec("set @@time_zone = 'America/Los_Angeles'") pool := pools.NewResourcePool(func() (pools.Resource, error) { return tk.Session(), nil }, 1, 1, time.Second) defer pool.Close() timerStore := tablestore.NewTableTimerStore(1, pool, dbName, tblName, nil) defer timerStore.Close() watermark, err := time.ParseInLocation(time.DateTime, "2024-11-03 09:30:00", time.UTC) require.NoError(t, err) id, err := timerStore.Create(context.TODO(), &api.TimerRecord{ TimerSpec: api.TimerSpec{ Namespace: "default", Key: "test", SchedPolicyType: api.SchedEventInterval, SchedPolicyExpr: "1h", Watermark: watermark, }, }) require.NoError(t, err) timer, err := timerStore.GetByID(context.TODO(), id) require.NoError(t, err) // this assert will fail require.Equal(t, watermark.In(time.UTC).String(), timer.Watermark.In(time.UTC).String()) }
test success
--- FAIL: TestTimerStoreWithDST (2.53s) Expected :2024-11-03 09:30:00 +0000 UTC Actual :2024-11-03 08:30:00 +0000 UTC
The text was updated successfully, but these errors were encountered:
timer: fix some timezone behavior in timer framework (#51783)
d708569
close #51768
lcwangchao
Successfully merging a pull request may close this issue.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
The below test will fail:
2. What did you expect to see? (Required)
test success
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: