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

fix: useTableSorting tests fails randomly, causing PR check to fail #13631

Merged
merged 2 commits into from
Sep 25, 2024

Conversation

Jondyr
Copy link
Member

@Jondyr Jondyr commented Sep 25, 2024

Description

useTableSorting tests failed randomly (around once per 10 test runs for me locally). This is likely because useTableSorting's useEffect was not properly waited for. Changed waitFor to act.

Example of PR check failing:
https://github.com/Altinn/altinn-studio/actions/runs/11014485052/job/30585221160?pr=13573

tested locally with:
(for i in {1..100}; do (yarn test --ci useTableSorting.test.tsx)&; done);

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

@Jondyr Jondyr changed the title fix: useTableSorting fails randomly fix: useTableSorting tests fails randomly Sep 25, 2024
@github-actions github-actions bot added the solution/studio/designer Issues related to the Altinn Studio Designer solution. label Sep 25, 2024
Copy link

codecov bot commented Sep 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.24%. Comparing base (49d1da7) to head (df831e2).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13631   +/-   ##
=======================================
  Coverage   95.24%   95.24%           
=======================================
  Files        1502     1502           
  Lines       20581    20581           
  Branches     2492     2492           
=======================================
  Hits        19603    19603           
  Misses        869      869           
  Partials      109      109           

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

@Jondyr Jondyr changed the title fix: useTableSorting tests fails randomly fix: useTableSorting tests fails randomly, causing PR check to fail Sep 25, 2024
@Jondyr Jondyr marked this pull request as ready for review September 25, 2024 08:03
@Jondyr Jondyr added frontend quality/testing Tests that are missing, needs to be created or could be improved. kind/bug Used when there is a defect / something is not working as it should. labels Sep 25, 2024
@ErlingHauan ErlingHauan self-assigned this Sep 25, 2024
Copy link
Contributor

@ErlingHauan ErlingHauan left a comment

Choose a reason for hiding this comment

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

Nice fix!

@ErlingHauan ErlingHauan removed their assignment Sep 25, 2024
@framitdavid framitdavid added the skip-releasenotes Issues that do not make sense to list in our release notes label Sep 25, 2024
@framitdavid
Copy link
Collaborator

I added skip-release notes on this one since it's only "internal" code that is changed. 😊 Waiting for all PR checks to turn green before merging. Since it's a unit test that is fixed, no further manual testing is required. 👏

@framitdavid framitdavid self-assigned this Sep 25, 2024
Copy link
Collaborator

@framitdavid framitdavid left a comment

Choose a reason for hiding this comment

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

Great work! :)

@framitdavid framitdavid merged commit 6b0343b into main Sep 25, 2024
10 checks passed
@framitdavid framitdavid deleted the fix/flaky-unit-test-usetablesorting branch September 25, 2024 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend kind/bug Used when there is a defect / something is not working as it should. quality/testing Tests that are missing, needs to be created or could be improved. skip-releasenotes Issues that do not make sense to list in our release notes solution/studio/designer Issues related to the Altinn Studio Designer solution.
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants