File tree 2 files changed +9
-3
lines changed
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,11 @@ def pytest_configure(config: tp.Any) -> None:
102
102
config .stash [metadata_key ]["MIXED_P2P" ] = str (configuration .MIXED_P2P )
103
103
config .stash [metadata_key ]["NUM_POOLS" ] = str (configuration .NUM_POOLS )
104
104
config .stash [metadata_key ]["UTXO_BACKEND" ] = configuration .UTXO_BACKEND
105
+ config .stash [metadata_key ]["MAX_TESTS_PER_CLUSTER" ] = configuration .MAX_TESTS_PER_CLUSTER
106
+ # If not explicitly specified, the `CLUSTERS_COUNT` is calculated based on number of xdist
107
+ # workers, which is not known yet by the time this fixture runs.
108
+ if os .environ .get ("CLUSTERS_COUNT" ) is not None :
109
+ config .stash [metadata_key ]["CLUSTERS_COUNT" ] = configuration .CLUSTERS_COUNT
105
110
if configuration .CONFIRM_BLOCKS_NUM :
106
111
config .stash [metadata_key ]["CONFIRM_BLOCKS_NUM" ] = str (configuration .CONFIRM_BLOCKS_NUM )
107
112
config .stash [metadata_key ]["HAS_CC" ] = str (configuration .HAS_CC )
Original file line number Diff line number Diff line change 57
57
msg = f"Invalid COMMAND_ERA: { COMMAND_ERA } "
58
58
raise RuntimeError (msg )
59
59
60
- CLUSTERS_COUNT = int (os .environ .get ("CLUSTERS_COUNT" ) or 0 )
61
- WORKERS_COUNT = int (os .environ .get ("PYTEST_XDIST_WORKER_COUNT" ) or 1 )
60
+ XDIST_WORKERS_COUNT = int (os .environ .get ("PYTEST_XDIST_WORKER_COUNT" ) or 0 )
62
61
MAX_TESTS_PER_CLUSTER = int (os .environ .get ("MAX_TESTS_PER_CLUSTER" ) or 8 )
63
- CLUSTERS_COUNT = int (CLUSTERS_COUNT or (min (WORKERS_COUNT , 9 )))
62
+ # If CLUSTERS_COUNT is not set, use the number of xdist workers or 1
63
+ CLUSTERS_COUNT = int (os .environ .get ("CLUSTERS_COUNT" ) or 0 )
64
+ CLUSTERS_COUNT = int (CLUSTERS_COUNT or (min (XDIST_WORKERS_COUNT , 9 )) or 1 )
64
65
65
66
DEV_CLUSTER_RUNNING = bool (os .environ .get ("DEV_CLUSTER_RUNNING" ))
66
67
FORBID_RESTART = bool (os .environ .get ("FORBID_RESTART" ))
You can’t perform that action at this time.
0 commit comments