⚠️ CI failed on Wheel builder (last failure: Dec 26, 2025) ⚠️

**CI is still failing on [Wheel builder](https://github.com/scikit-learn/scikit-learn/actions/runs/20515594700)** (Dec 26, 2025)

COMMENT:
December 15, weird timeout in Windows arm64 in `sklearn/experimental/tests/test_enable_hist_gradient_boosting.py::test_import_raises_warning`  [build log](https://github.com/scikit-learn/scikit-learn/actions/runs/20220053683/job/58040295837#step:5:2862). Running the following snippet in a subprocess doesn't succeed in less than one minute ...
```py
import pytest
with pytest.warns(UserWarning, match="it is not needed to import"):
    from sklearn.experimental import enable_hist_gradient_boosting  # noqa
```

<details><summary>Details</summary>
<p>

```pytb
  _________________________ test_import_raises_warning __________________________
  
  source_code = '\nimport pytest\nwith pytest.warns(UserWarning, match="it is not needed to import"):\n    from sklearn.experimental import enable_hist_gradient_boosting  # noqa\n'
  pattern = 'it is not needed to import enable_hist_gradient_boosting anymore'
  timeout = 60
  
      def assert_run_python_script_without_output(source_code, pattern=".+", timeout=60):
          """Utility to check assertions in an independent Python subprocess.
      
          The script provided in the source code should return 0 and the stdtout +
          stderr should not match the pattern `pattern`.
      
          This is a port from cloudpickle https://github.com/cloudpipe/cloudpickle
      
          Parameters
          ----------
          source_code : str
              The Python source code to execute.
          pattern : str
              Pattern that the stdout + stderr should not match. By default, unless
              stdout + stderr are both empty, an error will be raised.
          timeout : int, default=60
              Time in seconds before timeout.
          """
          fd, source_file = tempfile.mkstemp(suffix="_src_test_sklearn.py")
          os.close(fd)
          try:
              with open(source_file, "wb") as f:
                  f.write(source_code.encode("utf-8"))
              cmd = [sys.executable, source_file]
              cwd = op.normpath(op.join(op.dirname(sklearn_path), ".."))
              env = os.environ.copy()
              try:
                  env["PYTHONPATH"] = os.pathsep.join([cwd, env["PYTHONPATH"]])
              except KeyError:
                  env["PYTHONPATH"] = cwd
              kwargs = {"cwd": cwd, "stderr": STDOUT, "env": env}
              # If coverage is running, pass the config file to the subprocess
              coverage_rc = os.environ.get("COVERAGE_PROCESS_START")
              if coverage_rc:
                  kwargs["env"]["COVERAGE_PROCESS_START"] = coverage_rc
      
              kwargs["timeout"] = timeout
              try:
                  try:
  >                   out = check_output(cmd, **kwargs)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
  ..\venv-test\Lib\site-packages\sklearn\utils\_testing.py:941: 
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  ..\..\..\..\pypa\cibuildwheel\Cache\nuget-cpython\pythonarm64.3.14.0\tools\Lib\subprocess.py:472: in check_output
      return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  ..\..\..\..\pypa\cibuildwheel\Cache\nuget-cpython\pythonarm64.3.14.0\tools\Lib\subprocess.py:556: in run
      stdout, stderr = process.communicate(input, timeout=timeout)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ..\..\..\..\pypa\cibuildwheel\Cache\nuget-cpython\pythonarm64.3.14.0\tools\Lib\subprocess.py:1220: in communicate
      stdout, stderr = self._communicate(input, endtime, timeout)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  
  self = <Popen: returncode: 1 args: ['C:\\Users\\runneradmin\\AppData\\Local\\Temp\\...>
  input = None, endtime = 8767.9305961, orig_timeout = 60
  
      def _communicate(self, input, endtime, orig_timeout):
          # Start reader threads feeding into a list hanging off of this
          # object, unless they've already been started.
          if self.stdout and not hasattr(self, "_stdout_buff"):
              self._stdout_buff = []
              self.stdout_thread = \
                      threading.Thread(target=self._readerthread,
                                       args=(self.stdout, self._stdout_buff))
              self.stdout_thread.daemon = True
              self.stdout_thread.start()
          if self.stderr and not hasattr(self, "_stderr_buff"):
              self._stderr_buff = []
              self.stderr_thread = \
                      threading.Thread(target=self._readerthread,
                                       args=(self.stderr, self._stderr_buff))
              self.stderr_thread.daemon = True
              self.stderr_thread.start()
      
          if self.stdin:
              self._stdin_write(input)
      
          # Wait for the reader threads, or time out.  If we time out, the
          # threads remain reading and the fds left open in case the user
          # calls communicate again.
          if self.stdout is not None:
              self.stdout_thread.join(self._remaining_time(endtime))
              if self.stdout_thread.is_alive():
  >               raise TimeoutExpired(self.args, orig_timeout)
  E               subprocess.TimeoutExpired: Command '['C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-0_1us9xp\\cp314-win_arm64\\venv-test\\Scripts\\python.exe', 'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\tmpt2aa_yad_src_test_sklearn.py']' timed out after 60 seconds
  
  ..\..\..\..\pypa\cibuildwheel\Cache\nuget-cpython\pythonarm64.3.14.0\tools\Lib\subprocess.py:1644: TimeoutExpired
  
  During handling of the above exception, another exception occurred:
  
      @pytest.mark.xfail(_IS_WASM, reason="cannot start subprocess")
      def test_import_raises_warning():
          code = """
          import pytest
          with pytest.warns(UserWarning, match="it is not needed to import"):
              from sklearn.experimental import enable_hist_gradient_boosting  # noqa
          """
          pattern = "it is not needed to import enable_hist_gradient_boosting anymore"
  >       assert_run_python_script_without_output(textwrap.dedent(code), pattern=pattern)
  
  ..\venv-test\Lib\site-packages\sklearn\experimental\tests\test_enable_hist_gradient_boosting.py:19: 
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  
  source_code = '\nimport pytest\nwith pytest.warns(UserWarning, match="it is not needed to import"):\n    from sklearn.experimental import enable_hist_gradient_boosting  # noqa\n'
  pattern = 'it is not needed to import enable_hist_gradient_boosting anymore'
  timeout = 60
  
      def assert_run_python_script_without_output(source_code, pattern=".+", timeout=60):
          """Utility to check assertions in an independent Python subprocess.
      
          The script provided in the source code should return 0 and the stdtout +
          stderr should not match the pattern `pattern`.
      
          This is a port from cloudpickle https://github.com/cloudpipe/cloudpickle
      
          Parameters
          ----------
          source_code : str
              The Python source code to execute.
          pattern : str
              Pattern that the stdout + stderr should not match. By default, unless
              stdout + stderr are both empty, an error will be raised.
          timeout : int, default=60
              Time in seconds before timeout.
          """
          fd, source_file = tempfile.mkstemp(suffix="_src_test_sklearn.py")
          os.close(fd)
          try:
              with open(source_file, "wb") as f:
                  f.write(source_code.encode("utf-8"))
              cmd = [sys.executable, source_file]
              cwd = op.normpath(op.join(op.dirname(sklearn_path), ".."))
              env = os.environ.copy()
              try:
                  env["PYTHONPATH"] = os.pathsep.join([cwd, env["PYTHONPATH"]])
              except KeyError:
                  env["PYTHONPATH"] = cwd
              kwargs = {"cwd": cwd, "stderr": STDOUT, "env": env}
              # If coverage is running, pass the config file to the subprocess
              coverage_rc = os.environ.get("COVERAGE_PROCESS_START")
              if coverage_rc:
                  kwargs["env"]["COVERAGE_PROCESS_START"] = coverage_rc
      
              kwargs["timeout"] = timeout
              try:
                  try:
                      out = check_output(cmd, **kwargs)
                  except CalledProcessError as e:
                      raise RuntimeError(
                          "script errored with output:\n%s" % e.output.decode("utf-8")
                      )
      
                  out = out.decode("utf-8")
                  if re.search(pattern, out):
                      if pattern == ".+":
                          expectation = "Expected no output"
                      else:
                          expectation = f"The output was not supposed to match {pattern!r}"
      
                      message = f"{expectation}, got the following output instead: {out!r}"
                      raise AssertionError(message)
              except TimeoutExpired as e:
  >               raise RuntimeError(
                      "script timeout, output so far:\n%s" % e.output.decode("utf-8")
                  )
  E               RuntimeError: script timeout, output so far:
  
  ..\venv-test\Lib\site-packages\sklearn\utils\_testing.py:957: RuntimeError
```

</p>
</details>

Labels: Bug