Skip to content

Commit 24cc5fc

Browse files
authored
[Data] Fix flakey test_operators (ray-project#56028)
1 parent b2355ec commit 24cc5fc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

python/ray/data/tests/test_operators.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ def dummy_all_transform(bundles: List[RefBundle], ctx):
139139

140140
# Check we return transformed bundles.
141141
assert not op.completed()
142-
assert _take_outputs(op) == [[1, 2], [3, 4]]
142+
outputs = _take_outputs(op)
143+
expected = [[1, 2], [3, 4]]
144+
assert sorted(outputs) == expected, f"Expected {expected}, got {outputs}"
143145
stats = op.get_stats()
144146
assert "FooStats" in stats
145147
assert op.completed()
@@ -515,7 +517,9 @@ def test_map_operator_ray_args(shutdown_only, use_actors):
515517
run_op_tasks_sync(op)
516518

517519
# Check we don't hang and complete with num_gpus=1.
518-
assert _take_outputs(op) == [[i * 2] for i in range(10)]
520+
outputs = _take_outputs(op)
521+
expected = [[i * 2] for i in range(10)]
522+
assert sorted(outputs) == expected, f"Expected {expected}, got {outputs}"
519523
assert op.completed()
520524

521525

0 commit comments

Comments
 (0)