Skip to content

fix(coderd): prevent lost messages in watchWorkspaceAgentMetadata #7934

New issue

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

Merged
merged 4 commits into from
Jun 13, 2023

Conversation

mafredri
Copy link
Member

@mafredri mafredri commented Jun 9, 2023

@@ -1461,7 +1461,6 @@ func (api *API) watchWorkspaceAgentMetadata(rw http.ResponseWriter, r *http.Requ
case <-senderClosed:
return
case <-refreshTicker.C:
break
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: Ineffective break => confusing.

@mafredri mafredri changed the title test(coderd): Fix TestWorkspaceAgent_Metadata flake test(coderd): fix TestWorkspaceAgent_Metadata flake Jun 9, 2023
@mafredri mafredri requested review from ammario and johnstcn June 9, 2023 13:56
@mafredri mafredri marked this pull request as ready for review June 9, 2023 13:56
Copy link
Member

@ammario ammario left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might make sense to move this into the nightly-gauntlet test

@mafredri
Copy link
Member Author

Might make sense to move this into the nightly-gauntlet test

@ammario hopefully that's not necessary. I believe I've now identified the main culprits for the test failures and fixed them in bf7d092 (#7934) and 78f9bb6 (#7934).

There were two issues of missing messages in between subscriptions:

  1. Were returning from WatchWorkspaceAgentMetadata before the subscription was initialized, so messages were lost in between
  2. We were sending initial metadata from the server before subscribing, so again, messages were lost in between

@mafredri mafredri force-pushed the mafredri/fix-coderd-metadata-test branch from b6d4d88 to 2a53d6a Compare June 13, 2023 12:14
@mafredri mafredri changed the title test(coderd): fix TestWorkspaceAgent_Metadata flake fix(coderd): Prevent lost messages in watchWorkspaceAgentMetadata Jun 13, 2023
@mafredri mafredri changed the title fix(coderd): Prevent lost messages in watchWorkspaceAgentMetadata fix(coderd): prevent lost messages in watchWorkspaceAgentMetadata Jun 13, 2023
@mafredri mafredri enabled auto-merge (squash) June 13, 2023 12:21
@mafredri mafredri merged commit 1d0fae8 into main Jun 13, 2023
@mafredri mafredri deleted the mafredri/fix-coderd-metadata-test branch June 13, 2023 12:21
@github-actions github-actions bot locked and limited conversation to collaborators Jun 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants