fix: poll job.status() once per job in Experiment.status() - #582
Conversation
Experiment.status() called job.status(runner=...) twice while building one status row: once for the display text and again for the returned dictionary. A backend failure therefore produced two identical ERROR tracebacks per status request and wasted a redundant status poll. Store the status in a local variable and reuse it for both the display string and the dict. Add a regression test that asserts job.status() is called exactly once for both return_dict=True and the default print path. Signed-off-by: Andrew White <andrewh@cdw.com>
|
/review |
|
🔎 On it — resolving the pull request and reviewing it rigorously. |
|
🤖 On it — handling this as review. |
|
💬 LGTM — #582 Verdict: No blocking findings. Blocking findings: None. Non-blocking findings: None. Review details: Validation: All 18 non-skipped checks on the exact head |
Summary
Experiment.status()calledjob.status(runner=...)twice while building one status row: once for the display text and again for the returned dictionary. A backend failure therefore produced two identical ERROR tracebacks per status request and wasted a redundant status poll.This was flagged as a non-blocking follow-up in #569.
Changes
job.status(runner=self._runner)in a local variable and reuse it for both the display string and the returned dict innemo_run/run/experiment.py.test/run/test_experiment.pyassertingjob.status()is called exactly once for bothreturn_dict=Trueand the default print path.Testing
Result: 1 passed.
Ruff lint and format also pass on the changed files.
Contributor guidelines