Commit 1e136b7
[Data] Simplify and remove the ordering dependency of download expression error handling tests (ray-project#58518)
## Description
This PR refactors tests in `test_download_expression.py` to make them
easier to maintain and less prone to brittle failures. Some of the
previous tests were more complex than necessary and relied on
assumptions that could occasionally cause false negatives.
### Key updates:
* **Reduce flaky behavior**: Added explicit sorting by ID in
`test_download_expression_handles_failed_downloads` to avoid relying on
a specific output order, which isn’t guaranteed and could sometimes
cause intermittent failures.
* **Simplify test logic**: Reduced
`test_download_expression_failed_size_estimation` from 30 URIs to just
1. A single failing URI is sufficient to confirm that failed downloads
don’t trigger divide-by-zero errors, and this change makes the test
easier to understand and faster to run.
* **Improve readability**: Replaced `pa.Table.from_arrays()` with
`ray.data.from_items()`, which makes the test setup more straightforward
for future maintainers.
* **Remove redundancy**: Deleted
`test_download_expression_mixed_valid_and_invalid_size_estimation`,
since its behavior is already covered by the other tests.
Overall, these updates streamline the test suite, making it faster,
clearer, and more robust while keeping the key behaviors fully verified.
## Related issue
ray-project#58464 (comment)
---------
Signed-off-by: Balaji Veeramani <bveeramani@berkeley.edu>
Signed-off-by: Xinyu Zhang <60529799+xyuzh@users.noreply.github.com>
Signed-off-by: Robert Nishihara <robertnishihara@gmail.com>
Co-authored-by: Xinyu Zhang <60529799+xyuzh@users.noreply.github.com>
Co-authored-by: Robert Nishihara <robertnishihara@gmail.com>
Signed-off-by: justinyeh1995 <justinyeh1995@gmail.com>1 parent 80eb240 commit 1e136b7
1 file changed
+21
-66
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
302 | 305 | | |
303 | 306 | | |
304 | 307 | | |
| |||
324 | 327 | | |
325 | 328 | | |
326 | 329 | | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
338 | 335 | | |
339 | | - | |
340 | | - | |
341 | | - | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
342 | 342 | | |
343 | | - | |
344 | | - | |
345 | 343 | | |
346 | 344 | | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
380 | 348 | | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
| 349 | + | |
| 350 | + | |
385 | 351 | | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
| 352 | + | |
| 353 | + | |
399 | 354 | | |
400 | 355 | | |
401 | 356 | | |
| |||
0 commit comments