Skip to content

fix(e2e): add ResponseNotFound retry to statistics test#3277

Open
The-Obstacle-Is-The-Way wants to merge 1 commit intohuggingface:mainfrom
The-Obstacle-Is-The-Way:fix/e2e-flaky-statistics-test
Open

fix(e2e): add ResponseNotFound retry to statistics test#3277
The-Obstacle-Is-The-Way wants to merge 1 commit intohuggingface:mainfrom
The-Obstacle-Is-The-Way:fix/e2e-flaky-statistics-test

Conversation

@The-Obstacle-Is-The-Way
Copy link
Copy Markdown

Summary

Fixes flaky test_statistics_endpoint by adding retry logic for ResponseNotFound (404) errors.

The test was failing intermittently because it didn't wait for the split-descriptive-statistics worker job to complete before asserting.

Fix

Added should_retry_x_error_codes=["ResponseNotFound"] - the same pattern already used in:

  • test_52_search.py
  • test_54_rows.py
  • test_55_first_rows.py

Change

statistics_response = poll_until_ready_and_assert(
    relative_url=f"/statistics?dataset={dataset}&config={config}&split={split}",
    check_x_revision=True,
    dataset=dataset,
    should_retry_x_error_codes=["ResponseNotFound"],  # Added
)

+2 lines, follows existing codebase pattern.

@The-Obstacle-Is-The-Way The-Obstacle-Is-The-Way force-pushed the fix/e2e-flaky-statistics-test branch 2 times, most recently from 18efa9e to c141330 Compare December 12, 2025 23:21
The test_statistics_endpoint was flaky because it failed immediately
on ResponseNotFound (404) instead of retrying. This happens when the
split-descriptive-statistics worker job hasn't completed yet.

This follows the established pattern used in test_55_first_rows.py,
test_52_search.py, test_53_filter.py, and test_54_rows.py which all
use should_retry_x_error_codes=["ResponseNotFound"] for the same reason.
@The-Obstacle-Is-The-Way The-Obstacle-Is-The-Way force-pushed the fix/e2e-flaky-statistics-test branch from c141330 to c8a5d89 Compare December 18, 2025 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant