Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

test: add logging to TestWorkspaceActivityBump/Dial#15089

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Emyrk merged 4 commits intomainfromstevenmasley/activitybump_flake
Oct 16, 2024

Conversation

Emyrk
Copy link
Member

@EmyrkEmyrk commentedOct 15, 2024
edited
Loading

My initial notes:coder/internal#102 (comment)

I am a bit split on how best to solve this. It is a classic problem of what isnow.

At it's core, what is happening is:

  1. Workspace activity bump happens
  2. Detect bump
  3. Takenow
  4. Assertdeadeline-now=1hr

For an unknown reason,Detect Bump seems to have taken 10s in the flake failure. Sonow has drifted 10s later then step 1.

Our time tolerance is 10s, so the test fails.

Without more logs, it's difficult to know for certain. What makes this more confusing, is theDetect bump should detect when the bump happens, meaningnow should be relative to when this loop unblocks.

So the implementation of takingnow after the loop is correct.

What did I do then?

I added logging information to output timing information of this for loop. If we get another failure, this timing information should be helpful.

I also made the time drift allowed (was 10s) to match the maximum waiting time of the for loop. It's not perfect, but now the loop should take max ~15s, and the time comparison will allow 15s leeway.


Just a note that I do not believe there is any bugs in the production code. Looking at the failure logs, the activity bump works as expected.

If a test is running slow, the workspace deadline check can beslow. Since we use 'now' as a reference point, any time driftwill affect the results.
@EmyrkEmyrk changed the titlechore: add log statements to detect a slow test checktest: add logging to TestWorkspaceActivityBump/DiaOct 15, 2024
If the hypothesis of a 10s time drift is true, this loop might beacting slow.
waitedFor := time.Now()
// lastChecked is for logging within the Eventually loop.
// Debouncing log lines to every second to prevent spam.
lastChecked := time.Time{}
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Made totime.Time so the first loop is always logged.

@EmyrkEmyrk changed the titletest: add logging to TestWorkspaceActivityBump/Diatest: add logging to TestWorkspaceActivityBump/DialOct 15, 2024
@EmyrkEmyrk merged commit774c9dd intomainOct 16, 2024
29 checks passed
@EmyrkEmyrk deleted the stevenmasley/activitybump_flake branchOctober 16, 2024 15:01
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsOct 16, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@spikecurtisspikecurtisspikecurtis approved these changes

Assignees

@EmyrkEmyrk

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@Emyrk@spikecurtis

[8]ページ先頭

©2009-2025 Movatter.jp