File tree Expand file tree Collapse file tree
tests/prague/eip2537_bls_12_381_precompiles Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -167,8 +167,14 @@ class BLSPointGenerator:
167167 # G2 cofactor h₂: (x⁸ - 4x⁷ + 5x⁶ - 4x⁴ + 6x³ - 4x² - 4x + 13)/9
168168 G2_COFACTOR = 0x5D543A95414E7F1091D50792876A202CD91DE4547085ABAA68A205B2E5A7DDFA628F1CB4D9E82EF21537E293A6691AE1616EC6E786F0C70CF1C38E31C7238E5 # noqa: E501
169169
170- # Memory cache for expensive functions
171- memory = Memory (location = ".cache" , verbose = 0 )
170+ # Memory cache for expensive functions. Give each xdist worker its own
171+ # cache dir: joblib's disk cache races on concurrent writes, and these
172+ # functions run at collection time in every worker.
173+ _xdist_worker = os .environ .get ("PYTEST_XDIST_WORKER" , "" )
174+ _cache_location = (
175+ f".cache/joblib-{ _xdist_worker } " if _xdist_worker else ".cache"
176+ )
177+ memory = Memory (location = _cache_location , verbose = 0 )
172178
173179 @staticmethod
174180 def is_on_curve_g1 (x : int , y : int ) -> bool :
You can’t perform that action at this time.
0 commit comments