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

#9150 Introduce SandboxInjectionError and increase sandbox timeouts to 5s #9168

Merged
merged 6 commits into from
Sep 18, 2024

Conversation

mnholtz
Copy link
Collaborator

@mnholtz mnholtz commented Sep 17, 2024

What does this PR do?

  • Part of [Spike] render_nunjucks error spike #9150
  • While we haven't identified root cause of [Spike] render_nunjucks error spike #9150, this PR
    1. Increases the timeout associated with injecting & sending messages to the sandbox from 3s to 5s (to address the hypothesis that this error is happening on slow machines) and
    2. Introduces a more specific SandboxInjectionError to be explicit about the cause of the sandbox errors we are seeing (to rule out the less-strong hypothesis that the sandbox is getting removed from the page more often than before)

Discussion

Copy link

codecov bot commented Sep 17, 2024

Codecov Report

Attention: Patch coverage is 15.38462% with 11 lines in your changes missing coverage. Please review.

Project coverage is 74.80%. Comparing base (8318d74) to head (a79c9bb).
Report is 299 commits behind head on main.

Files with missing lines Patch % Lines
src/sandbox/messenger/api.ts 0.00% 8 Missing ⚠️
src/utils/injectIframe.tsx 25.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9168      +/-   ##
==========================================
+ Coverage   74.24%   74.80%   +0.55%     
==========================================
  Files        1332     1360      +28     
  Lines       40817    41886    +1069     
  Branches     7634     7826     +192     
==========================================
+ Hits        30306    31331    +1025     
- Misses      10511    10555      +44     

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

Copy link

github-actions bot commented Sep 17, 2024

Playwright test results

passed  125 passed
flaky  3 flaky
skipped  4 skipped

Details

report  Open report ↗︎
stats  132 tests across 44 suites
duration  11 minutes, 55 seconds
commit  a79c9bb
info  For more information on how to debug and view this report, see our readme

Flaky tests

chrome › tests/pageEditor/addStarterBrick.spec.ts › Add starter brick to mod
msedge › tests/pageEditor/addStarterBrick.spec.ts › Add starter brick to mod
msedge › tests/pageEditor/copyMod.spec.ts › run a copied mod with a built-in integration

Skipped tests

chrome › tests/regressions/doNotCloseSidebarOnPageEditorSave.spec.ts › #8104: Do not automatically close the sidebar when saving in the Page Editor
msedge › tests/regressions/doNotCloseSidebarOnPageEditorSave.spec.ts › #8104: Do not automatically close the sidebar when saving in the Page Editor
chrome › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options
msedge › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options

@@ -27,6 +30,7 @@ import { TimeoutError } from "p-timeout";
import { isSpecificError } from "@/errors/errorHelpers";

const SANDBOX_SHADOW_ROOT_ID = "pixiebrix-sandbox";
const MAX_RETRIES = 3;
Copy link
Collaborator Author

@mnholtz mnholtz Sep 17, 2024

Choose a reason for hiding this comment

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

We might want to consider increasing MAX_RETRIES as well.

@grahamlangford if we can get this into a beta build & have users try this out before we release, that would be ideal. We were seeing a spike in this error in the beta build for the last release. Might give us an opportunity to tweak our approach before releasing

@mnholtz mnholtz marked this pull request as ready for review September 17, 2024 22:54
const TIMEOUT_MS = 5000;

export class SandboxInjectionError extends Error {
constructor(message: string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: prefer override. See examples:

override name = "HeadlessModeError";

override name = "SandboxInjectionError";

@twschiller twschiller added this to the 2.1.2 milestone Sep 17, 2024
Copy link

No loom links were found in the first post. Please add one there if you'd like to it to appear on Slack.

Do not edit this comment manually.

@mnholtz mnholtz merged commit 29016dc into main Sep 18, 2024
20 checks passed
@mnholtz mnholtz deleted the bugfix/9150_render_nunjucks_spike branch September 18, 2024 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants