File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 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:
102102 config .stash [metadata_key ]["MIXED_P2P" ] = str (configuration .MIXED_P2P )
103103 config .stash [metadata_key ]["NUM_POOLS" ] = str (configuration .NUM_POOLS )
104104 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
105110 if configuration .CONFIRM_BLOCKS_NUM :
106111 config .stash [metadata_key ]["CONFIRM_BLOCKS_NUM" ] = str (configuration .CONFIRM_BLOCKS_NUM )
107112 config .stash [metadata_key ]["HAS_CC" ] = str (configuration .HAS_CC )
Original file line number Diff line number Diff line change 5757 msg = f"Invalid COMMAND_ERA: { COMMAND_ERA } "
5858 raise RuntimeError (msg )
5959
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 )
6261MAX_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 )
6465
6566DEV_CLUSTER_RUNNING = bool (os .environ .get ("DEV_CLUSTER_RUNNING" ))
6667FORBID_RESTART = bool (os .environ .get ("FORBID_RESTART" ))
You can’t perform that action at this time.
0 commit comments