Skip to content

Commit ec4f6a5

Browse files
alongdclaude
andcommitted
tests: per-xdist-worker project dirs in sp_composite classes
main now runs pytest with -n auto --dist=worksteal; a class-shared project dir gets wiped by setUpClass on one worker while another worker's tests are using it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 0dfb666 commit ec4f6a5

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

arc/scheduler_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,8 +1273,9 @@ class TestSchedulerSpCompositeOrchestration(unittest.TestCase):
12731273
@classmethod
12741274
def setUpClass(cls):
12751275
cls.ess_settings = {'gaussian': ['server1'], 'molpro': ['server2', 'server1']}
1276+
worker = os.environ.get('PYTEST_XDIST_WORKER', 'master')
12761277
cls.project_directory = os.path.join(
1277-
ARC_PATH, 'Projects', 'arc_project_for_testing_sp_composite_orch'
1278+
ARC_PATH, 'Projects', f'arc_project_for_testing_sp_composite_orch_{worker}'
12781279
)
12791280
if os.path.isdir(cls.project_directory):
12801281
shutil.rmtree(cls.project_directory, ignore_errors=True)
@@ -2483,8 +2484,9 @@ class TestSchedulerSpCompositePassthrough(unittest.TestCase):
24832484
@classmethod
24842485
def setUpClass(cls):
24852486
cls.ess_settings = {'gaussian': ['server1'], 'molpro': ['server2', 'server1']}
2487+
worker = os.environ.get('PYTEST_XDIST_WORKER', 'master')
24862488
cls.project_directory = os.path.join(
2487-
ARC_PATH, 'Projects', 'arc_project_for_testing_sp_composite_passthrough'
2489+
ARC_PATH, 'Projects', f'arc_project_for_testing_sp_composite_passthrough_{worker}'
24882490
)
24892491
cls.spc = ARCSpecies(label='H2', smiles='[H][H]')
24902492

0 commit comments

Comments
 (0)