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

Prevent infinite loop when error is thrown during play invocation #115

Merged
merged 13 commits into from
Mar 19, 2024

Conversation

trotzig
Copy link
Contributor

@trotzig trotzig commented Mar 19, 2024

In case the play function throws an error, we didn't properly disambiguate it from the internal error thrown by
forceHappoScreenshot. This caused the test suite to re-render the last step over and over (until eventually the browser crashed). To fix this, I'm adding a done boolean to the step created by forceHappoScreenshot. Each step is only allowed to be processed once.

It's a little annoying that the errored event details do not contain any information about the thrown error. If it did, we wouldn't have to do this complicated detection to see if the error is ours or someone elses.

In case the play function throws an error, we didn't properly
disambiguate it from the internal error thrown by
`forceHappoScreenshot`. This caused the test suite to re-render the last
step over and over (until eventually the browser crashed). To fix this,
I'm adding a `done` boolean to the step created by forceHappoScreenshot.
Each step is only allowed to be processed once.

It's a little annoying that the `errored` event details do not contain
any information about the thrown error. If it did, we wouldn't have to
do this complicated detection to see if the error is ours or someone
elses.
trotzig added 2 commits March 19, 2024 10:04
This should help fix the following issue:

Error: Unable to perform pointer interaction as the element has `pointer-events: none`:

BUTTON(label=click me)
    at assertPointerEvents (http://localhost:4433/784.fc9cd2d3.iframe.bundle.js:1:965181)
    at Object.enter (http://localhost:4433/784.fc9cd2d3.iframe.bundle.js:1:968154)
    at Object.move (http://localhost:4433/784.fc9cd2d3.iframe.bundle.js:1:973957)
    at pointerAction (http://localhost:4433/784.fc9cd2d3.iframe.bundle.js:1:985358)
    at Object.pointer (http://localhost:4433/784.fc9cd2d3.iframe.bundle.js:1:992810)
Before, I was only letting the report get created, without comparing the
results with a previous version. This was limiting and I often found
myself having to manually compare with the previous state.
I couldn't get yarn to execute the bash script that
happo-ci-github-actions is. Going to try wrapping it in a scripts entry
to ensure bash is used.
trotzig added 2 commits March 19, 2024 10:47
This will ensure that I can run happo-ci-github-actions in CI.
I'm trying to figure out if there's a discrepancy between the local
version and the CI version.
This is the version we use locally. Hoping it will make errors less
confusing.
trotzig added 6 commits March 19, 2024 11:22
Hoping this will fix the shebang issue.
--frozen-lockfile is deprecated
This will make the lockfile up-to-date with what CI will expect.
Hoping this could help.
I'm hoping this will help resolve the following error:

/home/runner/work/happo-plugin-storybook/happo-plugin-storybook/node_modules/happo.io/bin/happo-ci:3
^

SyntaxError: Invalid or unexpected token
    at internalCompileFunction (node:internal/vm:73:18)
    at wrapSafe (node:internal/modules/cjs/loader:1274:20)
    at Module._compile (node:internal/modules/cjs/loader:1320:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
    at Module.load (node:internal/modules/cjs/loader:1197:32)
    at Module._load (node:internal/modules/cjs/loader:1013:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
    at node:internal/main/run_main_module:28:49
I'm running into so many issues right now that I'm trying to switch back
to classic yarn.
@trotzig trotzig merged commit 2d4e09c into master Mar 19, 2024
7 checks passed
@trotzig trotzig deleted the prevent-loop branch March 19, 2024 10:39
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.

1 participant