[GH-ISSUE #6353] [Issue]: e2e "Home lifecycle stays bounded" fails at random on its 3 MB heap budget (desktop-chromium) #3551

Closed
opened 2026-10-21 06:04:11 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @kolacheee on GitHub (Sep 19, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6353

Originally assigned to: @SpicyMarinara on GitHub.

Summary

The desktop-chromium e2e test "Home lifecycle stays bounded across repeated tab and chat navigation" (e2e/core-flows.e2e.ts:19834) fails at random on its heap budget. It has failed the first CI run of four unrelated pull requests in two days (#6327, #6330, #6343, #6348) and passed on a re-run each time. None of those PRs touch the Home page or the spec.

Expected behavior

The test fails only when Home really keeps memory after the tab and chat cycles.

Actual behavior

The only assertion that fails is the heap one (e2e/core-flows.e2e.ts:20062):

expect(after.heap).toBeLessThanOrEqual(baseline.heap + 3 * 1024 * 1024)
Expected: <= 46857812
Received:    47187504

That run was 0.31 MB over a 3 MB allowance on a heap of about 45 MB. The earlier ones were about 0.8 MB over. Every other counter in the same test (documents, nodes, listeners, intervals, resize observers, timeouts, animation frames) held, which is what a real leak would move first.

The sample was already hardened once in #5704 (settledHeapUsage: three HeapProfiler.collectGarbage passes, keep the smallest reading). It still trips, so the noise between two settled samples on a CI runner is larger than the 3 MB allowance gives room for.

Steps to reproduce

  1. Open a PR against staging that does not touch the Home page.
  2. Watch desktop-chromium 3/4 in the e2e workflow.
  3. About one first run in three fails on this test; "Re-run failed jobs" passes.

Environment

  • Marinara Engine version: staging (seen on d091ad7d3 and earlier)
  • Install type: CI (GitHub Actions e2e workflow, desktop-chromium project)
  • OS + version: GitHub-hosted Ubuntu runner
  • Browser or app shell: Playwright Chromium

Logs, screenshots, or video

Latest occurrence: https://github.com/Pasta-Devs/Marinara-Engine/actions/runs/35427239766/job/105855261944 (PR #6348). The test attaches home-lifecycle-counters (baseline and after) to the Playwright report of each run.

Additional context

Ideas, smallest first:

  • Keep the leak check but make the heap one relative, for example 10 percent of the baseline instead of a flat 3 MB, since the structural counters already catch a retained Home tree.
  • Take the baseline after more warm-up cycles (it is taken after 2, the comparison after 10 more), so lazily created caches and JIT data are in the baseline.
  • Compare the smallest of several collect() rounds on both sides instead of one round each.

Related: #5704 (the first hardening), #5589 (the red regression matrix that led to it).

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @kolacheee on GitHub (Sep 19, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6353 Originally assigned to: @SpicyMarinara on GitHub. ## Summary The desktop-chromium e2e test "Home lifecycle stays bounded across repeated tab and chat navigation" (`e2e/core-flows.e2e.ts:19834`) fails at random on its heap budget. It has failed the first CI run of four unrelated pull requests in two days (#6327, #6330, #6343, #6348) and passed on a re-run each time. None of those PRs touch the Home page or the spec. ## Expected behavior The test fails only when Home really keeps memory after the tab and chat cycles. ## Actual behavior The only assertion that fails is the heap one (`e2e/core-flows.e2e.ts:20062`): ``` expect(after.heap).toBeLessThanOrEqual(baseline.heap + 3 * 1024 * 1024) Expected: <= 46857812 Received: 47187504 ``` That run was 0.31 MB over a 3 MB allowance on a heap of about 45 MB. The earlier ones were about 0.8 MB over. Every other counter in the same test (documents, nodes, listeners, intervals, resize observers, timeouts, animation frames) held, which is what a real leak would move first. The sample was already hardened once in #5704 (`settledHeapUsage`: three `HeapProfiler.collectGarbage` passes, keep the smallest reading). It still trips, so the noise between two settled samples on a CI runner is larger than the 3 MB allowance gives room for. ## Steps to reproduce 1. Open a PR against `staging` that does not touch the Home page. 2. Watch `desktop-chromium 3/4` in the e2e workflow. 3. About one first run in three fails on this test; "Re-run failed jobs" passes. ## Environment - Marinara Engine version: `staging` (seen on d091ad7d3 and earlier) - Install type: CI (GitHub Actions e2e workflow, desktop-chromium project) - OS + version: GitHub-hosted Ubuntu runner - Browser or app shell: Playwright Chromium ## Logs, screenshots, or video Latest occurrence: https://github.com/Pasta-Devs/Marinara-Engine/actions/runs/35427239766/job/105855261944 (PR #6348). The test attaches `home-lifecycle-counters` (baseline and after) to the Playwright report of each run. ## Additional context Ideas, smallest first: - Keep the leak check but make the heap one relative, for example 10 percent of the baseline instead of a flat 3 MB, since the structural counters already catch a retained Home tree. - Take the baseline after more warm-up cycles (it is taken after 2, the comparison after 10 more), so lazily created caches and JIT data are in the baseline. - Compare the smallest of several `collect()` rounds on both sides instead of one round each. Related: #5704 (the first hardening), #5589 (the red regression matrix that led to it). ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 06:04:11 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Sep 19, 2026):

Owner: @SpicyMarinara, assisted by Codex. Taking this report in the issue sweep tracked by draft PR #6359. I will trace the affected path, keep the fix small, and record the relevant regression proof before merging to staging.

<!-- gh-comment-id:5741686896 --> @SpicyMarinara commented on GitHub (Sep 19, 2026): Owner: @SpicyMarinara, assisted by Codex. Taking this report in the issue sweep tracked by draft PR #6359. I will trace the affected path, keep the fix small, and record the relevant regression proof before merging to staging.
Author
Owner

@SpicyMarinara commented on GitHub (Sep 19, 2026):

Merged to staging in #6359. The Home lifecycle heap allowance now scales with the warmed baseline (10%), while structural leak assertions stay exact. Three consecutive local lifecycle runs passed.

<!-- gh-comment-id:5742476804 --> @SpicyMarinara commented on GitHub (Sep 19, 2026): Merged to staging in #6359. The Home lifecycle heap allowance now scales with the warmed baseline (10%), while structural leak assertions stay exact. Three consecutive local lifecycle runs passed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#3551
No description provided.