Update: a failed test start of the new engine names the kept log file to report (#4692)
This commit is contained in:
1 parent
cfa7f737cc
commit
0b1808f072
2 files changed
+28
-1
No files matched your search
@@ -908,7 +908,11 @@ def _test_start_failure(component: ec.EngineComponent, started: dict, ctx: Conte
|
||||
return TestStartFailed(component.version, f"it was still loading the model after {minutes} minutes", busy=True,
|
||||
hint="Nothing was changed. A slow disk or a card that other programs are using can do this: close them and run "
|
||||
"`strata update` again." + kept)
|
||||
return TestStartFailed(component.version, f"it did not answer a one-token probe ({error or started.get('state')}){tail}")
|
||||
reason = f"it did not answer a one-token probe ({error or started.get('state')}){tail}"
|
||||
# #4692: "report it with the log" named no log. The engine's words stay out of the sentence, but the person is told where the kept log is.
|
||||
hint = (None if TestStartFailed.BUSY.search(reason) else
|
||||
f"Run `strata update --force` to try again; if it fails again, report it with the log: {log}")
|
||||
return TestStartFailed(component.version, reason, hint=hint)
|
||||
|
||||
|
||||
TEST_CONTEXT = 4096
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
"""#4692: a failed one-token test start says where the kept engine log is (it said "report it with the log" and named none)."""
|
||||
import tempfile
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
from types import SimpleNamespace
|
||||
|
||||
from strata_control import updater
|
||||
|
||||
|
||||
class ProbeHint(unittest.TestCase):
|
||||
def test_the_message_names_the_kept_log(self):
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
ctx = SimpleNamespace(test_timeout=600, components=Path(tmp))
|
||||
component = SimpleNamespace(version="0.1.54")
|
||||
exc = updater._test_start_failure(component, {"error": "process_exited", "state": "failed"}, ctx, " | boom")
|
||||
text = str(exc)
|
||||
self.assertIn("test-start-0.1.54.log", text)
|
||||
self.assertIn("strata update --force", text)
|
||||
self.assertNotIn("boom", text) # the engine's own words stay out of the sentence
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user