Skip to content

CI Non-deterministic failure for sklearn/ensemble/tests/test_forest.py::test_missing_values_is_resilient on some CI builds #33510

Closed

Description

@lucolivi

Describe the bug and give evidence about its user-facing impact

CI for PR #33405 failing on apparently non related feature test see build log

Error seems to be related to #32119

Steps/Code to Reproduce

CI routine

Expected Results

No error is thrown

Actual Results

Error is something like:

FAILED ensemble/tests/test_forest.py::test_missing_values_is_resilient[ExtraTreesRegressor-squared_error] - assert 0.7297597961942053 >= (0.8 * 0.92069077181028)
Image

Versions

n/a

Interest in fixing the bug

No

Activity

  1. added
    Needs Triage
    on Mar 10, 2026
  2. changed the title [-]PR CI failing on non-related test[/-] [+]PR #33405 CI failing on non-related test[/+] on Mar 10, 2026
  3. lucolivi commented on Mar 10, 2026

    @lucolivi
    ContributorAuthor

    This seems to be an intermittent bug due to random values.

    https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/ensemble/tests/test_forest.py#L1844-L1847

    It is a good idea to expand line 1846 so that the random seed becomes visible in test error log.

  4. lucolivi commented on Mar 10, 2026

    @lucolivi
    ContributorAuthor

    I've performed couple of runs locally (win11) and it seems that is a rare event the difference asserted in the test to be < 0.
    Perhaps there is some platform specific influence in the algorithms tested.

    Image
  5. lesteve commented on Mar 11, 2026

    @lesteve
    Member

    Thanks for the issue! The sklearn/ensemble/tests/test_forest.py::test_missing_values_is_resilient was seen in other places as well, pymin_conda_forge_arm, free-threaded and Pyodide, see #33470 (comment).

    cc @cakedev0 for a closer look.

  6. changed the title [-]PR #33405 CI failing on non-related test[/-] [+]CI Non-deterministic failure for sklearn/ensemble/tests/test_forest.py::test_missing_values_is_resilient on some platforms[/+] on Mar 11, 2026
  7. added
    Needs Investigation
    on Mar 11, 2026
  8. changed the title [-]CI Non-deterministic failure for sklearn/ensemble/tests/test_forest.py::test_missing_values_is_resilient on some platforms[/-] [+]CI Non-deterministic failure for `sklearn/ensemble/tests/test_forest.py::test_missing_values_is_resilient` on some CI builds[/+] on Mar 11, 2026
  9. lesteve commented on Mar 11, 2026

    @lesteve
    Member

    Also seen on macOS Intel see build log from PR #33508.

  10. cakedev0 commented on Mar 11, 2026

    @cakedev0
    Member

    Hi, very sorry about that, it seems I committed by mistake some local changes for testing the robustness. I will open a PR to fix that.

  11. lucolivi commented on Mar 11, 2026

    @lucolivi
    ContributorAuthor

    Hi @cakedev0, I felt strange that despite 300+ runs of test_missing_values_is_resilient locally, none raised error (in contrast it happened in the CI apparently more frequent).

    Although fixing random seed is a quick-fix necessary here, the problem might be deeper and platform-dependent, specially if the 0.8 threshold that was used is theoretical (dont know if it is)

  12. cakedev0 commented on Mar 11, 2026

    @cakedev0
    Member

    Hi, I have the same feeling that it might be deeper and platform-dependent, but it's probably a really small thing: the tests only fail by a small margin when they do. Not sure it's worth investigating.

    0.8 is not a theoretical threshold.

  13. lesteve commented on Mar 11, 2026

    @lesteve
    Member

    Hi, very sorry about that, it seems I committed by mistake some local changes for testing the robustness. I will open a PR to fix that.

    No worries, things like this happen and at the end of the day reviewers may/should have caught it 😉. Not blaming them either, we are all human 😉.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugBuild / CINeeds InvestigationNeeds Triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions