Skip to content
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

tests: fix flaky tests #7676

Merged
merged 5 commits into from Nov 21, 2023
Merged

tests: fix flaky tests #7676

merged 5 commits into from Nov 21, 2023

Conversation

BeryJu
Copy link
Member

@BeryJu BeryJu commented Nov 21, 2023

Details

So the Docker API takes healthcheck intervals/delays as nanoseconds (most likely due to the Golang's handling of time/duration), and the containers in our e2e tests should've been using a 5s initial delay and then a 5s interval. However due to maths being...hard, they were actually being healthchecked every 500ms, due to a missing 0.

I'm honestly surprised this hasn't broken more things, although I suppose we'll never know how many test failures this caused by hogging all the CPU to do healthchecks.

The main culprit that brought this to light was docker:dind, which would crash consistently (at least locally) with those insane intervals set.


Checklist

  • Local tests pass (ak test authentik/)
  • The code has been formatted (make lint-fix)

If an API change has been made

  • The API schema has been updated (make gen-build)

If changes to the frontend have been made

  • The code has been formatted (make web)
  • The translation files have been updated (make i18n-extract)

If applicable

  • The documentation has been updated
  • The documentation has been formatted (make website)

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
@BeryJu BeryJu requested a review from a team as a code owner November 21, 2023 21:49
Copy link

netlify bot commented Nov 21, 2023

Deploy Preview for authentik-storybook canceled.

Name Link
🔨 Latest commit bb2c495
🔍 Latest deploy log https://app.netlify.com/sites/authentik-storybook/deploys/655d3121c9ada600081010f0

Copy link

codecov bot commented Nov 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (68d266a) 92.64% compared to head (bb2c495) 92.63%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7676      +/-   ##
==========================================
- Coverage   92.64%   92.63%   -0.01%     
==========================================
  Files         588      588              
  Lines       29140    29140              
==========================================
- Hits        26997    26995       -2     
- Misses       2143     2145       +2     
Flag Coverage Δ
e2e 50.70% <ø> (-0.01%) ⬇️
integration 25.93% <ø> (ø)
unit 89.71% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
@BeryJu BeryJu requested a review from a team as a code owner November 21, 2023 22:04
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
@BeryJu BeryJu merged commit 6f8d216 into main Nov 21, 2023
63 checks passed
@BeryJu BeryJu deleted the tests/fix-flaky-tests branch November 21, 2023 22:50
@BeryJu
Copy link
Member Author

BeryJu commented Dec 19, 2023

/cherry-pick version-2023.10

gcp-cherry-pick-bot bot pushed a commit that referenced this pull request Dec 19, 2023
* tests: fix flaky tests

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* make test-from-stable use actual latest version

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* fix checkout

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* remove hardcoded seed

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* ignore tests for now i guess idk

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
BeryJu added a commit that referenced this pull request Dec 19, 2023
tests: fix flaky tests (#7676)

* tests: fix flaky tests



* make test-from-stable use actual latest version



* fix checkout



* remove hardcoded seed



* ignore tests for now i guess idk



---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Jens L <jens@goauthentik.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant