-
Type:
Task
-
Resolution: Won't Do
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
DB Integration & Observability
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Currently scripting_legacy_mozjs_test tears down and recreates a mozjs ScriptEngine multiple times in the same process (once for each test case). This is not a supported pattern by SpiderMonkey, and it requires custom changes to the SpiderMonkey code to make it work - in the existing integration and for the ESR 153 upgrade.
This is error-prone and difficult to maintain, as each custom SpiderMonkey change carries a risk of introducing unintended side-effects, and each SpiderMonkey upgrade could require more custom changes to maintain support for this behaviour. The production server never tears down and recreates engines in the same process, so the changes are purely for the sake of the tests.
Instead we should restructure the unit tests to avoid this pattern so we don't have to keep modifying SpiderMonkey code.