fix: Subtract a second when listening in TestWorkspaceBuildLogs (#2588)

This allowed a test flake seen here:
https://github.com/coder/coder/runs/7009119403?check_suite_focus=true#step:9:151
This commit is contained in:
Kyle Carberry
2022-06-22 12:48:03 -05:00
committed by GitHub
parent cfbda57990
commit 3f9776784c

View File

@ -325,7 +325,7 @@ func TestWorkspaceBuildLogs(t *testing.T) {
workspace := coderdtest.CreateWorkspace(t, client, user.OrganizationID, template.ID)
ctx, cancelFunc := context.WithCancel(context.Background())
t.Cleanup(cancelFunc)
logs, err := client.WorkspaceBuildLogsAfter(ctx, workspace.LatestBuild.ID, before)
logs, err := client.WorkspaceBuildLogsAfter(ctx, workspace.LatestBuild.ID, before.Add(-time.Second))
require.NoError(t, err)
for {
log, ok := <-logs