Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit88f0131

Browse files
fix: use dbtime in dbmem query to fix flake (#16773)
Closescoder/internal#447.The test was failing 30% of the time on Windows without the roundingapplied by `dbtime`. `dbtime` was used on the timestamps inserted intothe DB, but not within the query. Once using `dbtime` within the querythere were no failures in 200 runs.
1 parent0f4f6bd commit88f0131

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎coderd/database/dbmem/dbmem.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7014,7 +7014,7 @@ func (q *FakeQuerier) GetWorkspaceAgentUsageStatsAndLabels(_ context.Context, cr
70147014
}
70157015
// WHERE usage = true AND created_at > now() - '1 minute'::interval
70167016
// GROUP BY user_id, agent_id, workspace_id
7017-
ifagentStat.Usage&&agentStat.CreatedAt.After(time.Now().Add(-time.Minute)) {
7017+
ifagentStat.Usage&&agentStat.CreatedAt.After(dbtime.Now().Add(-time.Minute)) {
70187018
val,ok:=latestAgentStats[key]
70197019
if!ok {
70207020
latestAgentStats[key]=agentStat

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp