From a3f64f74f794c733126ad21cd1feb0801caf67c4 Mon Sep 17 00:00:00 2001 From: Danielle Maywood Date: Mon, 21 Jul 2025 10:49:26 +0000 Subject: [PATCH] fix(coderd): fix flake in `TestAPI/ModifyAutostopWithRunningWorkspace` --- coderd/workspaces_test.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/coderd/workspaces_test.go b/coderd/workspaces_test.go index f99e3b9e3ec3f..141c62ff3a4b3 100644 --- a/coderd/workspaces_test.go +++ b/coderd/workspaces_test.go @@ -2875,13 +2875,18 @@ func TestWorkspaceUpdateTTL(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong) defer cancel() - err := client.UpdateWorkspaceTTL(ctx, workspace.ID, codersdk.UpdateWorkspaceTTLRequest{ - TTLMillis: testCase.toTTL, - }) + // Re-fetch the workspace build. This is required because + // `AwaitWorkspaceBuildJobCompleted` can return stale data. + build, err := client.WorkspaceBuild(ctx, build.ID) require.NoError(t, err) deadlineBefore := build.Deadline + err = client.UpdateWorkspaceTTL(ctx, workspace.ID, codersdk.UpdateWorkspaceTTLRequest{ + TTLMillis: testCase.toTTL, + }) + require.NoError(t, err) + build, err = client.WorkspaceBuild(ctx, build.ID) require.NoError(t, err) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy