From 1026d186ce5510548eb4f7366e99bfda3ce33658 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Fri, 1 Apr 2022 10:24:03 -0700 Subject: [PATCH] CI/TST: Make test_vector_resize more deterministic --- pandas/tests/libs/test_hashtable.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/pandas/tests/libs/test_hashtable.py b/pandas/tests/libs/test_hashtable.py index bed427da5dd12..0a3a10315b5fd 100644 --- a/pandas/tests/libs/test_hashtable.py +++ b/pandas/tests/libs/test_hashtable.py @@ -246,16 +246,7 @@ def test_lookup_overflow(self, writable): (ht.Float64HashTable, ht.Float64Vector, "float64", False), (ht.Int64HashTable, ht.Int64Vector, "int64", False), (ht.Int32HashTable, ht.Int32Vector, "int32", False), - pytest.param( - ht.UInt64HashTable, - ht.UInt64Vector, - "uint64", - False, - marks=pytest.mark.xfail( - reason="Sometimes doesn't raise.", - strict=False, - ), - ), + (ht.UInt64HashTable, ht.UInt64Vector, "uint64", False), ], ) def test_vector_resize( @@ -263,7 +254,9 @@ def test_vector_resize( ): # Test for memory errors after internal vector # reallocations (GH 7157) - vals = np.array(np.random.randn(1000), dtype=dtype) + # Changed from using np.random.rand to range + # which could cause flaky CI failures when safely_resizes=False + vals = np.array(range(1000), dtype=dtype) # GH 21688 ensures we can deal with read-only memory views vals.setflags(write=writable)