Skip to content

Commit bea02f3

Browse files
authored
CI/TST: Make test_vector_resize more deterministic (#46602)
1 parent 0bec088 commit bea02f3

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

pandas/tests/libs/test_hashtable.py

+4-11
Original file line numberDiff line numberDiff line change
@@ -246,24 +246,17 @@ def test_lookup_overflow(self, writable):
246246
(ht.Float64HashTable, ht.Float64Vector, "float64", False),
247247
(ht.Int64HashTable, ht.Int64Vector, "int64", False),
248248
(ht.Int32HashTable, ht.Int32Vector, "int32", False),
249-
pytest.param(
250-
ht.UInt64HashTable,
251-
ht.UInt64Vector,
252-
"uint64",
253-
False,
254-
marks=pytest.mark.xfail(
255-
reason="Sometimes doesn't raise.",
256-
strict=False,
257-
),
258-
),
249+
(ht.UInt64HashTable, ht.UInt64Vector, "uint64", False),
259250
],
260251
)
261252
def test_vector_resize(
262253
self, writable, htable, uniques, dtype, safely_resizes, nvals
263254
):
264255
# Test for memory errors after internal vector
265256
# reallocations (GH 7157)
266-
vals = np.array(np.random.randn(1000), dtype=dtype)
257+
# Changed from using np.random.rand to range
258+
# which could cause flaky CI failures when safely_resizes=False
259+
vals = np.array(range(1000), dtype=dtype)
267260

268261
# GH 21688 ensures we can deal with read-only memory views
269262
vals.setflags(write=writable)

0 commit comments

Comments
 (0)