[PR #5704] [MERGED] test(e2e): stabilise the home lifecycle heap sample and the mobile CYOA boot wait #6895

Closed
opened 2026-10-23 04:14:40 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5704
Author: @Gunterlie
Created: 8/31/2026
Status: ✅ Merged
Merged: 8/31/2026
Merged by: @Gunterlie

Base: staging ← Head: fix/home-lifecycle-heap-sample-flake


📝 Commits (4)

  • 1a56dfa test(e2e): settle the heap sample before the home lifecycle budget
  • 2451318 test(e2e): allow the mobile CYOA spec the game-surface boot budget
  • 02b3946 Merge branch 'staging' into fix/home-lifecycle-heap-sample-flake
  • 7ac32eb Merge branch 'staging' into fix/home-lifecycle-heap-sample-flake

📊 Changes

1 file changed (+25 additions, -6 deletions)

View changed files

📝 e2e/core-flows.e2e.ts (+25 -6)

📄 Description

Why

Two specs fail intermittently on unrelated PRs. Both were hit on #5700, whose diff swaps one textarea for MacroTextarea in the character editor — a component neither spec mounts.

1. Home lifecycle stays bounded across repeated tab and chat navigation fails on:

expect(after.heap).toBeLessThanOrEqual(baseline.heap + 3 * 1024 * 1024)

collect() issues a single HeapProfiler.collectGarbage and reads Runtime.getHeapUsage 150ms later. One collection leaves incrementally-freed memory uncollected, so a clean run can read megabytes above its own baseline purely on GC timing — inside a 3MB budget.

2. mobile Game keeps CYOA usable above four HUD widgets fails on its first assertion after page.goto("/") with "element(s) not found". That assertion absorbs app boot plus the lazily-imported GameSurface chunk (~500kB) and runs on the default 10s expect timeout, while the neighbouring game specs already allow 30s for the same wait (e2e/core-flows.e2e.ts:3503, :10897).

What

  1. The heap reading collects garbage three times and keeps the smallest usedSize. Retained memory survives every pass, so no leak detection is lost. The 3MB budget and every other counter are unchanged.
  2. The CYOA spec's first mount assertion gets the same 30s budget its siblings use. Every later assertion stays on the default timeout, so the layout checks the spec exists for are unaffected.

Test plan

  • pnpm check
  • Manually run desktop-chromium shard 3 and confirm the lifecycle spec passes
  • Manually re-run that shard several times and confirm the heap assertion is stable
  • Manually run mobile-webkit shard 4 and confirm the CYOA spec passes
  • Manually verify the lifecycle spec still fails when a real leak is introduced (for example, retain a node on Home across unmount)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/5704 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 8/31/2026 **Status:** ✅ Merged **Merged:** 8/31/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `staging` ← **Head:** `fix/home-lifecycle-heap-sample-flake` --- ### 📝 Commits (4) - [`1a56dfa`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1a56dfa836cbeaeac6f9e40fc0304f7b78bb16d4) test(e2e): settle the heap sample before the home lifecycle budget - [`2451318`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2451318f38b459324cd909e35d5a8ace045d0630) test(e2e): allow the mobile CYOA spec the game-surface boot budget - [`02b3946`](https://github.com/Pasta-Devs/Marinara-Engine/commit/02b39465ecb13d7b990b18b969be5d55b9431b07) Merge branch 'staging' into fix/home-lifecycle-heap-sample-flake - [`7ac32eb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7ac32ebca50ade7f9e33406de02dea876a4316e9) Merge branch 'staging' into fix/home-lifecycle-heap-sample-flake ### 📊 Changes **1 file changed** (+25 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `e2e/core-flows.e2e.ts` (+25 -6) </details> ### 📄 Description ## Why Two specs fail intermittently on unrelated PRs. Both were hit on #5700, whose diff swaps one `textarea` for `MacroTextarea` in the character editor — a component neither spec mounts. **1. `Home lifecycle stays bounded across repeated tab and chat navigation`** fails on: ``` expect(after.heap).toBeLessThanOrEqual(baseline.heap + 3 * 1024 * 1024) ``` `collect()` issues a single `HeapProfiler.collectGarbage` and reads `Runtime.getHeapUsage` 150ms later. One collection leaves incrementally-freed memory uncollected, so a clean run can read megabytes above its own baseline purely on GC timing — inside a 3MB budget. **2. `mobile Game keeps CYOA usable above four HUD widgets`** fails on its first assertion after `page.goto("/")` with "element(s) not found". That assertion absorbs app boot plus the lazily-imported `GameSurface` chunk (~500kB) and runs on the default 10s expect timeout, while the neighbouring game specs already allow 30s for the same wait (`e2e/core-flows.e2e.ts:3503`, `:10897`). ## What 1. The heap reading collects garbage three times and keeps the smallest `usedSize`. Retained memory survives every pass, so no leak detection is lost. The 3MB budget and every other counter are unchanged. 2. The CYOA spec's first mount assertion gets the same 30s budget its siblings use. Every later assertion stays on the default timeout, so the layout checks the spec exists for are unaffected. ## Test plan - [ ] `pnpm check` - [ ] Manually run `desktop-chromium` shard 3 and confirm the lifecycle spec passes - [ ] Manually re-run that shard several times and confirm the heap assertion is stable - [ ] Manually run `mobile-webkit` shard 4 and confirm the CYOA spec passes - [ ] Manually verify the lifecycle spec still fails when a real leak is introduced (for example, retain a node on Home across unmount) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:14:40 +07:00
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#6895
No description provided.