1
1
import json
2
2
import logging
3
3
import os
4
- import platform
5
4
import subprocess
6
5
import sys
7
6
import textwrap
@@ -57,7 +56,7 @@ def __init__(self) -> None:
57
56
self ._feature_infra_module_path = self .feature_path / "infrastructure"
58
57
self ._feature_infra_file = self .feature_path / "infrastructure.py"
59
58
self ._handlers_dir = self .feature_path / "handlers"
60
- self ._cdk_out_dir : Path = CDK_OUT_PATH / "-" . join ( platform . python_version_tuple ()) / self .feature_name
59
+ self ._cdk_out_dir : Path = CDK_OUT_PATH / self .feature_name
61
60
self ._stack_outputs_file = f'{ self ._cdk_out_dir / "stack_outputs.json" } '
62
61
63
62
if not self ._feature_infra_file .exists ():
@@ -287,6 +286,7 @@ def add_cfn_output(self, name: str, value: str, arn: str = ""):
287
286
288
287
289
288
def call_once (
289
+ job_id : str ,
290
290
task : Callable ,
291
291
tmp_path_factory : pytest .TempPathFactory ,
292
292
worker_id : str ,
@@ -296,6 +296,8 @@ def call_once(
296
296
297
297
Parameters
298
298
----------
299
+ id : str
300
+ Random string that uniquely identifies this call
299
301
task : Callable
300
302
Function to call once and JSON serialize result whether parallel test is enabled or not.
301
303
tmp_path_factory : pytest.TempPathFactory
@@ -318,7 +320,7 @@ def call_once(
318
320
else :
319
321
# tmp dir shared by all workers
320
322
root_tmp_dir = tmp_path_factory .getbasetemp ().parent
321
- cache = root_tmp_dir / f"{ PYTHON_RUNTIME_VERSION } _cache.json"
323
+ cache = root_tmp_dir / f"{ PYTHON_RUNTIME_VERSION } _ { job_id } _cache.json"
322
324
323
325
with FileLock (f"{ cache } .lock" ):
324
326
# If cache exists, return task outputs back
0 commit comments