session: persist partial results on abort mid-suite - #103
Conversation
acerv
left a comment
There was a problem hiding this comment.
The analysis might be good, but the implementation looks like AI slop.
The whole point is
If a KirkException is raised inside schedule(), that extend is never reached, so self._results stays empty.
So why not just catching the exception and populating the self._results instead of adding code around the issue? :-)
async def _schedule_once(self, suites_obj: List[Suite]) -> None:
"""
Schedule tests only once.
"""
try:
await self._scheduler.schedule(suites_obj)
finally:
self._results.extend(self._scheduler.results)
Also the tests for session stays inside test_session.py and we really want to test all SUT implementations, not faking it with an abstraction class.
3fb1170 to
c758a81
Compare
|
Feel free to ignore Static analysis errors. I will fix it soon. |
|
Also, please cleanup the commit message. In kirk we are following the LTP standards, which means kernel commit standards: short subject and precise description. We use Github mostly for CI and accepting PR, but the git history must be concise and simple. |
c758a81 to
9d1d68f
Compare
|
@acerv btw why are supported EOL versions of python ? Should not be much easier maintain only supported versions , ( maybe + 3.11 as that is still in leap/SLE fully supported ) |
We are supporting systems which are supported by LTP, even if they are in EOL: https://linux-test-project.readthedocs.io/en/latest/users/supported_systems.html it's actually not a big effort, we have full control of the code and enough wrappers to handle asyncio. The rest is done by the CI. |
|
wow .. 42.2 :D |
self._results is only extended after _scheduler.schedule() returns. When a KirkException is raised during scheduling (e.g. a CommunicationError on SUT connection loss), the extend is skipped and self._results stays empty, even though the scheduler already collected results for the tests that ran. The export guard (if self._results) then skips writing results.json, silently discarding those partial results. Wrap the extend in _schedule_once() with try/finally so results collected before the abort are always carried over and exported. Add a regression test in _TestSession, so it runs against every SUT implementation. Closes: linux-test-project#102 Signed-off-by: Ondřej Súkup <osukup@suse.com>
9d1d68f to
76aab18
Compare
|
Merged thanks |
self._results is only extended after _scheduler.schedule() returns. When
a KirkException is raised during scheduling (e.g. a CommunicationError on
SUT connection loss), the extend is skipped and self._results stays empty,
even though the scheduler already collected results for the tests that ran.
The export guard then skips writing results.json, discarding those results.
Wrap the extend in _schedule_once() with try/finally so results collected
before the abort are carried over and exported. Add a regression test in
_TestSession so it runs against every SUT implementation.
Closes #102