Skip to content

Commit 875b02b

Browse files
Subbarao Garlapatimeta-codesync[bot]
authored andcommitted
Disable Imports Monitor on Cinder jit test
Summary: Ensure that the Cinder jit test `test_max_code_size_slow` passes with Imports Monitor enabled (as we plan on Imports Monitor being enabled for all fbcode linux tests). This test broke on D82670645. The test tests the max code size, which seems to be getting thrown off with the inclusion of Imports Monitor code. Passing in the `-S` flag to the `subprocess.run` command disables the import of the `site` module. This module imports `sitecustomize` which is where startup functions like Imports Monitor and Lazy Imports are run. So by using `-S` we avoid adding Imports Monitor to the test. Note that this doesn't fix the root issue of the test being unstable, but a task (T240152676) has been filed for this. Reviewed By: alexmalyshev Differential Revision: D83766379 fbshipit-source-id: c6bafecbcaac32896ccba861493f7a4eb84e30db
1 parent 866f384 commit 875b02b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

cinderx/PythonLib/test_cinderx/test_cinderjit.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1597,6 +1597,7 @@ def g():
15971597
self.assertEqual(cinderx.jit.get_num_inlined_functions(g), 1)
15981598

15991599
def test_max_code_size_slow(self) -> None:
1600+
# TODO(T240152676): Improve stability of this test
16001601
call_limit = cinderx.jit.get_compile_after_n_calls()
16011602
if call_limit is None or call_limit > 10000:
16021603
raise unittest.SkipTest(
@@ -1632,7 +1633,8 @@ def junk{i}(j):
16321633
def run_test(
16331634
asserts_func: Callable[[list[str]], None], params: list[str]
16341635
) -> None:
1635-
args = [sys.executable]
1636+
# Disable the import of the site module with `-S` so Imports Monitor isn't enabled
1637+
args = [sys.executable, "-S"]
16361638
args.extend(params)
16371639
args.append("mod.py")
16381640
proc = subprocess.run(

0 commit comments

Comments
 (0)