Open Bug 1924771 Opened 1 year ago Updated 1 year ago

TypedArray compartment test isn't testing separate compartments

Categories

(Core :: JavaScript: Standard Library, task, P3)

task

Tracking

()

People

(Reporter: bthrall, Assigned: bthrall)

References

(Blocks 1 open bug)

Details

Attachments

(1 obsolete file)

The TypedArray of.js test for behavior across compartments doesn't create a new compartment. Apparently, newGlobal() used to create a new compartment by default, but no longer does.

These tests are apparently from a time when each newGlobal() created a
separate compartment by default, which is no longer the case.

There are many other tests that check calls from "other globals," but it isn't
clear if they are just concerned with the globals or they actually want a
separate compartment.

Severity: -- → N/A
Priority: -- → P3

Our tests get run with the --tbpl option in CI which runs each one in a bunch of different configurations. At least one if these should have the --more-compartments option, which does make newGlobal create a separate compartment. So, we should still have test coverage here even if it may not test what we expect when run locally with the default options.

Should I just close this bug, then? It sounds like the problem I thought I saw isn't really a problem.

:jonco, unless you see some value here, I'm going to close this bug.

Flags: needinfo?(jcoppeard)
Attachment #9431051 - Attachment is obsolete: true

Sorry I missed this needinfo.

If the test is explicitly testing something that requires separate compartments, then it should create a new compartment. Failure to do so means we won't test what we're trying to test unless we run with --tbpl and I assume most people don't run tests locally with this option. Plus it's confusing, hence this bug.

However it's not a super big deal since we do still get the test coverage we want on CI.

Flags: needinfo?(jcoppeard)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: