mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-05 07:48:45 +00:00
test_cfg_paths, test_component_start: the starts give the stub server 60 s, not 15-20 (a pass still returns as soon as it is ready; on a Windows PC with about 330 processes and a non-elevated account a start took 16 s against a 15 s wait)
This commit is contained in:
1 parent
8bbd64e971
commit
7726f80cba
2 files changed
+8
-8
No files matched your search
@@ -216,7 +216,7 @@ class StaleConfigPaths(UpdaterCase):
|
||||
path = self.qwen_config("term")
|
||||
new_engine, _ = self.two_updates()
|
||||
self.addCleanup(self.stop, "term")
|
||||
started = runtime.start("term", wait=15)
|
||||
started = runtime.start("term", wait=60)
|
||||
self.assertTrue(started["ok"], started)
|
||||
cfg = self.cfg_of(path)
|
||||
self.assertEqual(cfg["cwd"], str(self.control / "0.1.46"))
|
||||
@@ -225,7 +225,7 @@ class StaleConfigPaths(UpdaterCase):
|
||||
self.assertEqual(len(self.host_log_lines("term")), 1, self.host_log_lines("term"))
|
||||
self.assertIn("earlier Strata version", self.host_log_lines("term")[0])
|
||||
runtime.stop("term", timeout=12)
|
||||
again = runtime.start("term", wait=15)
|
||||
again = runtime.start("term", wait=60)
|
||||
self.assertTrue(again["ok"], again)
|
||||
self.assertEqual(len(self.host_log_lines("term")), 1, "nothing is rewritten the second time")
|
||||
|
||||
@@ -233,7 +233,7 @@ class StaleConfigPaths(UpdaterCase):
|
||||
path = self.qwen_config("app-1")
|
||||
self.two_updates()
|
||||
self.addCleanup(self.stop, "app-1")
|
||||
started = runtime.start("app-1", wait=15, die_with_pid=os.getpid())
|
||||
started = runtime.start("app-1", wait=60, die_with_pid=os.getpid())
|
||||
self.assertTrue(started["ok"], started)
|
||||
self.assertEqual(self.cfg_of(path)["cwd"], str(self.control / "0.1.46"))
|
||||
|
||||
@@ -243,14 +243,14 @@ class StaleConfigPaths(UpdaterCase):
|
||||
self.two_updates()
|
||||
self.addCleanup(self.stop, "app-2")
|
||||
planned = hashlib.sha256(path.read_bytes()).hexdigest()
|
||||
started = runtime.start("app-2", wait=15, expected_source_sha256=planned)
|
||||
started = runtime.start("app-2", wait=60, expected_source_sha256=planned)
|
||||
self.assertTrue(started["ok"], started)
|
||||
|
||||
def test_every_saved_profile_is_repaired_by_one_start(self):
|
||||
a, b = self.qwen_config("one"), self.qwen_config("two")
|
||||
self.two_updates()
|
||||
self.addCleanup(self.stop, "one")
|
||||
self.assertTrue(runtime.start("one", wait=15)["ok"])
|
||||
self.assertTrue(runtime.start("one", wait=60)["ok"])
|
||||
self.assertNotIn("0.1.44", self.without_output_path(b), "the Models page reads the other profiles' configs too")
|
||||
|
||||
def test_deepseek_cwd_exe_and_libraries_follow_the_update_too(self):
|
||||
|
||||
@@ -155,7 +155,7 @@ class ComponentStart(unittest.TestCase):
|
||||
body = bytearray((folder / library).read_bytes())
|
||||
body[100] ^= 0xFF # same size; only the full hash sees it
|
||||
(folder / library).write_bytes(bytes(body))
|
||||
code, result = self._cli("runtime", "start", "--profile", "app", "--wait", "20", "--shutdown-timeout", "2")
|
||||
code, result = self._cli("runtime", "start", "--profile", "app", "--wait", "60", "--shutdown-timeout", "2")
|
||||
self.assertEqual(code, 5, result) # the refusal is the first thing the user sees: no host, no server
|
||||
self.assertFalse(result["ok"])
|
||||
self.assertFalse((self.root / "ran.txt").exists(), "a package with a changed library must not run")
|
||||
@@ -165,7 +165,7 @@ class ComponentStart(unittest.TestCase):
|
||||
self.assertIsNone(runtime._read_state("app"), "no runtime host may exist after the refusal")
|
||||
|
||||
def test_no_engine_is_a_notice_and_starts_nothing(self):
|
||||
code, result = self._cli("runtime", "start", "--profile", "app", "--wait", "20", "--shutdown-timeout", "2")
|
||||
code, result = self._cli("runtime", "start", "--profile", "app", "--wait", "60", "--shutdown-timeout", "2")
|
||||
self.assertNotEqual(code, 0)
|
||||
self.assertFalse(result["ok"])
|
||||
self.assertFalse((self.root / "ran.txt").exists(), "no engine may run")
|
||||
@@ -180,7 +180,7 @@ class ComponentStart(unittest.TestCase):
|
||||
def test_a_tampered_engine_is_not_started(self):
|
||||
folder = install_fake_engine(self.components)
|
||||
(folder / "engine_main.py").write_text(FAKE_ENGINE + "# changed\n", encoding="utf-8")
|
||||
code, result = self._cli("runtime", "start", "--profile", "app", "--wait", "20", "--shutdown-timeout", "2")
|
||||
code, result = self._cli("runtime", "start", "--profile", "app", "--wait", "60", "--shutdown-timeout", "2")
|
||||
self.assertNotEqual(code, 0)
|
||||
self.assertFalse((self.root / "ran.txt").exists(), "a changed package must not run")
|
||||
|
||||
|
||||
Reference in new issue
Block a user