|
1 | 1 | import os
|
2 | 2 | import pytest
|
3 | 3 | import sys
|
4 |
| -import time |
5 | 4 |
|
6 | 5 | from ray._private.test_utils import (
|
7 | 6 | wait_for_condition,
|
|
10 | 9 | )
|
11 | 10 | import ray
|
12 | 11 |
|
13 |
| -from unittest import mock |
14 | 12 |
|
15 | 13 | if not os.environ.get("CI"):
|
16 | 14 | # This flags turns on the local development that link against current ray
|
@@ -145,48 +143,6 @@ def test_import(self):
|
145 | 143 | assert not check_local_files_gced(cluster)
|
146 | 144 |
|
147 | 145 |
|
148 |
| -# Set scope to "class" to force this to run before start_cluster, whose scope |
149 |
| -# is "function". We need these env vars to be set before Ray is started. |
150 |
| -@pytest.fixture(scope="class") |
151 |
| -def skip_local_gc(): |
152 |
| - with mock.patch.dict( |
153 |
| - os.environ, |
154 |
| - { |
155 |
| - "RAY_RUNTIME_ENV_SKIP_LOCAL_GC": "1", |
156 |
| - }, |
157 |
| - ): |
158 |
| - print("RAY_RUNTIME_ENV_SKIP_LOCAL_GC enabled.") |
159 |
| - yield |
160 |
| - |
161 |
| - |
162 |
| -class TestSkipLocalGC: |
163 |
| - @pytest.mark.skipif( |
164 |
| - os.environ.get("CI") and sys.platform != "linux", |
165 |
| - reason="Requires PR wheels built in CI, so only run on linux CI machines.", |
166 |
| - ) |
167 |
| - @pytest.mark.parametrize("field", ["conda", "pip"]) |
168 |
| - def test_skip_local_gc_env_var(self, skip_local_gc, start_cluster, field, tmp_path): |
169 |
| - cluster, address = start_cluster |
170 |
| - runtime_env = generate_runtime_env_dict(field, "python_object", tmp_path) |
171 |
| - ray.init(address, namespace="test", runtime_env=runtime_env) |
172 |
| - |
173 |
| - @ray.remote |
174 |
| - def f(): |
175 |
| - import pip_install_test # noqa: F401 |
176 |
| - |
177 |
| - return True |
178 |
| - |
179 |
| - assert ray.get(f.remote()) |
180 |
| - |
181 |
| - ray.shutdown() |
182 |
| - |
183 |
| - # Give enough time for potentially uninstalling a conda env |
184 |
| - time.sleep(10) |
185 |
| - |
186 |
| - # Check nothing was GC'ed |
187 |
| - assert not check_local_files_gced(cluster) |
188 |
| - |
189 |
| - |
190 | 146 | if __name__ == "__main__":
|
191 | 147 | if os.environ.get("PARALLEL_CI"):
|
192 | 148 | sys.exit(pytest.main(["-n", "auto", "--boxed", "-vs", __file__]))
|
|
0 commit comments