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

Core: Avoid getting stuck in locked state #29768

Merged
merged 8 commits into from
Dec 3, 2024
Merged

Core: Avoid getting stuck in locked state #29768

merged 8 commits into from
Dec 3, 2024

Conversation

ghengeveld
Copy link
Member

@ghengeveld ghengeveld commented Dec 2, 2024

Closes #29650

What I did

Resets the running property when refreshing the browser, regardless of the sessionStorage value. Allows (re)running tests when crashed, so one can get out of that state too.

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 77.7 MB 77.7 MB -3 B 1.21 0%
initSize 130 MB 130 MB 133 B -0.41 0%
diffSize 52.5 MB 52.5 MB 136 B -0.41 0%
buildSize 6.83 MB 6.83 MB 36 B 0.4 0%
buildSbAddonsSize 1.51 MB 1.51 MB 0 B -0.5 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.86 MB 1.86 MB 36 B 0.29 0%
buildSbPreviewSize 271 kB 271 kB 0 B -0.5 0%
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.84 MB 3.84 MB 36 B 0.25 0%
buildPreviewSize 3 MB 3 MB 0 B 0.42 0%
testBuildSize 0 B 0 B 0 B - -
testBuildSbAddonsSize 0 B 0 B 0 B - -
testBuildSbCommonSize 0 B 0 B 0 B - -
testBuildSbManagerSize 0 B 0 B 0 B - -
testBuildSbPreviewSize 0 B 0 B 0 B - -
testBuildStaticSize 0 B 0 B 0 B - -
testBuildPrebuildSize 0 B 0 B 0 B - -
testBuildPreviewSize 0 B 0 B 0 B - -
name before after diff z %
createTime 24.3s 10.9s -13s -404ms -0.62 -122.7%
generateTime 19.4s 22.5s 3.1s 0.17 14.1%
initTime 12s 15.8s 3.7s 0.57 23.9%
buildTime 7.7s 8.2s 479ms -0.85 5.8%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 6.2s 4.4s -1s -767ms -0.99 -39.7%
devManagerResponsive 4.3s 3.3s -1s -16ms -0.74 -30.1%
devManagerHeaderVisible 635ms 574ms -61ms -0.04 -10.6%
devManagerIndexVisible 710ms 603ms -107ms -0.42 -17.7%
devStoryVisibleUncached 1.2s 1.6s 385ms 0.04 23.2%
devStoryVisible 708ms 602ms -106ms -0.31 -17.6%
devAutodocsVisible 545ms 534ms -11ms 0.11 -2.1%
devMDXVisible 572ms 511ms -61ms -0.16 -11.9%
buildManagerHeaderVisible 623ms 503ms -120ms -0.61 -23.9%
buildManagerIndexVisible 632ms 516ms -116ms -0.62 -22.5%
buildStoryVisible 621ms 505ms -116ms -0.61 -23%
buildAutodocsVisible 465ms 411ms -54ms -0.69 -13.1%
buildMDXVisible 455ms 431ms -24ms -0.42 -5.6%

Greptile Summary

This PR fixes an issue where the testing module could get stuck in a locked state by resetting the running state and allowing test re-runs after crashes or browser refreshes.

  • Modified code/core/src/manager-api/modules/experimental_testmodule.ts to reset running property on browser refresh
  • Removed state.crashed condition from code/addons/test/src/components/TestProviderRender.tsx to allow re-running crashed tests
  • Updated code/core/src/manager/components/sidebar/TestingModule.tsx to enable test re-runs regardless of crash state
  • Ensures server state is properly synchronized with UI state to prevent locked conditions

@ghengeveld ghengeveld marked this pull request as ready for review December 2, 2024 14:37
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

LGTM

4 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link

nx-cloud bot commented Dec 2, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 8c82776. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

Copy link
Contributor

@JReinhold JReinhold left a comment

Choose a reason for hiding this comment

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

Minor comment, otherwise LGTM.

@ghengeveld ghengeveld merged commit f8a1255 into next Dec 3, 2024
60 checks passed
@ghengeveld ghengeveld deleted the fix-locked-state branch December 3, 2024 13:09
@github-actions github-actions bot mentioned this pull request Dec 3, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Testing module can get in a non-escapable state if runs are not completed
3 participants