@@ -1970,25 +1970,20 @@ async def test_create_rooted_hierarchy_invalid(impl: Literal["async", "sync"]) -
19701970 raise ValueError (f"Invalid impl: { impl } " )
19711971
19721972
1973- @pytest .mark .parametrize (
1974- "store" ,
1975- [
1976- pytest .param (
1977- "memory" ,
1978- marks = pytest .mark .skipif (
1979- IS_WASM , reason = "performance is marginally worse for Pyodide/WASM"
1980- ),
1981- ),
1982- ],
1983- indirect = True ,
1984- )
1973+ @pytest .mark .parametrize ("store" , ["memory" ], indirect = True )
19851974def test_group_members_performance (store : Store ) -> None :
19861975 """
19871976 Test that the execution time of Group.members is less than the number of members times the
19881977 latency for accessing each member.
19891978 """
19901979 get_latency = 0.1
19911980
1981+ # Performance for Pyodide is only marginally worse than for Python,
1982+ # usually in the 1.012~1.018 range for a latency of 0.1). So we add
1983+ # some lenience for the WASM case that should be sufficient for
1984+ # unpredictable ephemeral environments like CI.
1985+ lenience = 1.10 if IS_WASM else 1.00
1986+
19921987 # use the input store to create some groups
19931988 group_create = zarr .group (store = store )
19941989 num_groups = 10
@@ -2009,7 +2004,7 @@ def test_group_members_performance(store: Store) -> None:
20092004 _ = group_read .members ()
20102005 elapsed = time .time () - start
20112006
2012- assert elapsed < (num_groups * get_latency )
2007+ assert elapsed < (num_groups * get_latency ) * lenience
20132008
20142009
20152010@pytest .mark .parametrize ("store" , ["memory" ], indirect = True )
0 commit comments