Skip to content

Commit b09f08f

Browse files
committed
attempt ci fix
1 parent 158723a commit b09f08f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

cli/agent_test.go

+7-6
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,10 @@ func TestWorkspaceAgent(t *testing.T) {
261261
var (
262262
admin = coderdtest.CreateFirstUser(t, client)
263263
member, memberUser = coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
264+
called int64
265+
derpCalled int64
264266
)
265267

266-
var called int64
267-
var derpCalled int64
268268
setHandler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
269269
// Ignore client requests
270270
if r.Header.Get("X-Testing") == "agent" {
@@ -304,6 +304,7 @@ func TestWorkspaceAgent(t *testing.T) {
304304
coderdtest.NewWorkspaceAgentWaiter(t, client, r.Workspace.ID).
305305
MatchResources(matchAgentWithVersion).Wait()
306306

307+
ctx := testutil.Context(t, testutil.WaitLong)
307308
clientInv, root := clitest.New(t,
308309
"-v",
309310
"--no-feature-warning",
@@ -312,11 +313,11 @@ func TestWorkspaceAgent(t *testing.T) {
312313
"-n", "1",
313314
)
314315
clitest.SetupConfig(t, member, root)
315-
clitest.Start(t, clientInv)
316+
err := clientInv.WithContext(ctx).Run()
317+
require.NoError(t, err)
316318

317-
require.Eventually(t, func() bool {
318-
return atomic.LoadInt64(&called) > 0
319-
}, testutil.WaitShort, testutil.IntervalFast)
319+
require.Greater(t, atomic.LoadInt64(&called), int64(0), "expected coderd to be reached with custom headers")
320+
require.Greater(t, atomic.LoadInt64(&derpCalled), int64(0), "expected /derp to be called with custom headers")
320321
})
321322
}
322323

0 commit comments

Comments
 (0)