nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: skypilot-org/skypilot
Pull request #5884 (2025-06-05 11:34:03)

Fix autodown smoke test
<!-- Describe the changes in this PR -->

close https://github.com/skypilot-org/skypilot/issues/5885

<!-- Describe the tests ran -->
<!-- Unit tests (tests/test_*.py) are part of GitHub CI; below are tests that launch on the cloud. -->

Tested (run the relevant ones):

- [x] Code formatting: install pre-commit (auto-check on commit) or `bash format.sh`
- [ ] Any manual or new tests for this PR (please specify below)
- [x] All smoke tests: `/smoke-test` (CI) or `pytest tests/test_smoke.py` (local)
- [ ] Relevant individual tests: `/smoke-test -k test_name` (CI) or `pytest tests/test_smoke.py::test_name` (local)
- [x] Backward compatibility: `/quicktest-core` (CI) or `pytest tests/smoke_tests/test_backward_compat.py` (local)

<!-- CI commands (/-prefixed) can only be triggered by repo members -->


aylei: /smoke-test -k test_autodown
aylei: /smoke-test -k test_autostop

Patch:
diff --git a/sky/resources.py b/sky/resources.py
index 46e08d3f7..a8fbca87a 100644
--- a/sky/resources.py
+++ b/sky/resources.py
@@ -45,7 +45,9 @@ class AutostopConfig:
     # to be complete.
     enabled: bool
     # If enabled is False, these values are ignored.
-    idle_minutes: int = 5
+    # Keep the default value to 0 to make the behavior consistent with the CLI
+    # flags.
+    idle_minutes: int = 0
     down: bool = False
 
     def to_yaml_config(self) -> Union[Literal[False], Dict[str, Any]]:


Test patch:
diff --git a/tests/unit_tests/test_resources.py b/tests/unit_tests/test_resources.py
index 9d677849e..c895edfcf 100644
--- a/tests/unit_tests/test_resources.py
+++ b/tests/unit_tests/test_resources.py
@@ -676,7 +676,7 @@ def test_autostop_config():
     assert r.autostop_config is not None
     assert r.autostop_config.enabled is True
     assert r.autostop_config.down is True
-    assert r.autostop_config.idle_minutes == 5  # default value
+    assert r.autostop_config.idle_minutes == 0  # default value
 
     # Override with idle_minutes when no existing autostop config
     r = Resources()