test: load the popup's libraries once per test file, not on every boot (closes #428)
check / check (push) Failing after 1s
e2e / e2e-chrome (push) Failing after 1s
e2e / e2e-firefox (push) Failing after 1s

Every popup boot in the tests resets jest's module registry so that src/
loads fresh, and that also reloaded ethers, libsodium-wrappers-sumo, qrcode
and ethereum-blockies-base64 each time: more than half of a boot, and
tests/persistedFieldContract.test.js boots the popup 321 times.
tests/support/popupBoot.js now loads those four once per test file and hands
the same copies to every boot. No test or assertion changed. make test takes
10-15s on the shared build host instead of 23-29s.

Model: opus-5-5
This commit is contained in:
2026-10-04 12:39:56 +00:00
parent 43c236451f
commit 7949c73afd
3 changed files with 31 additions and 6 deletions
+6 -6
View File
@@ -5,12 +5,12 @@
# many-core shared host one per core took gigabytes of RAM per run.
#
# The timeout bounds a hung suite; it is not a performance budget. On the busy
# shared build host the suite takes 23-29s with three workers, so
# REPO_POLICIES' 30s cap is tight there, not comfortable. Inside the image the
# same suite also pays a cold jest cache and shares the runner with the rest of
# the build, which is not what that budget describes, so the Dockerfile raises
# the bound through AUTISTMASK_TEST_TIMEOUT. A cap a healthy suite can trip on a
# cold cache produces a red that means nothing, and teaches "just run it again".
# shared build host the suite takes 10-15s with three workers, inside
# REPO_POLICIES' 20s budget. Inside the image the same suite also pays a cold
# jest cache and shares the runner with the rest of the build, which is not what
# that budget describes, so the Dockerfile raises the bound through
# AUTISTMASK_TEST_TIMEOUT. A cap a healthy suite can trip on a cold cache
# produces a red that means nothing, and teaches "just run it again".
set -eu
ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"