Skip to content

chore: refactor AgentHasNotConnectedSinceWeek_LogsExpired #13802

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 3 commits into from
Jul 8, 2024
Merged

Conversation

mtojek
Copy link
Member

@mtojek mtojek commented Jul 8, 2024

Related: #13801

This PR refactors AgentHasNotConnectedSinceWeek_LogsExpired to get more debug insights into this specific unit test.

@mtojek mtojek self-assigned this Jul 8, 2024
@mtojek mtojek requested a review from dannykopping July 8, 2024 10:23
@mtojek mtojek marked this pull request as ready for review July 8, 2024 10:23
// when
closer := dbpurge.New(ctx, logger, db)
defer closer.Close()

// then
require.Eventually(t, func() bool {
agentLogs, err := db.GetWorkspaceAgentLogsAfter(ctx, database.GetWorkspaceAgentLogsAfterParams{
assert.Eventually(t, func() bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
assert.Eventually(t, func() bool {
require.Eventually(t, func() bool {

Copy link
Member Author

Choose a reason for hiding this comment

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

require.Eventually will fail with Condition never met. I want to run the follow-up assertion afterward to see what is on the list.

Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

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

LGTM

@mtojek mtojek merged commit 10aa32c into main Jul 8, 2024
28 checks passed
@mtojek mtojek deleted the 13801-flake-1 branch July 8, 2024 11:52
@github-actions github-actions bot locked and limited conversation to collaborators Jul 8, 2024
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.

2 participants