Skip to content

Conversation

@acerv
Copy link
Collaborator

@acerv acerv commented Nov 6, 2025

Change the way we complete session by introducing forcibly stop. The
way that kirk works after this patch is the following:

  • if user sends SIGINT or CTRL+C, we simply wait for the running
    tests to complete and finally stop the session

  • if user sends SIGINT or CTRL+C again, we stop any execution on the SUT
    and we terminate the testing suite, flagging the killed test as TSKIP

Signed-off-by: Andrea Cervesato andrea.cervesato@suse.com
Closes: #78

@acerv acerv requested a review from metan-ucw November 6, 2025 14:57
@acerv acerv self-assigned this Nov 6, 2025
@acerv acerv added the enhancement New feature or request label Nov 6, 2025
@acerv acerv force-pushed the force_stop branch 4 times, most recently from c73e750 to 200f221 Compare November 7, 2025 10:03
Copy link
Member

@metan-ucw metan-ucw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, minus the unconditional handling for SIGKILL in the ltp,py. If that is fixed you can add my Reviewed-by: Cyril Hrubis chrubis@suse.cz

@acerv acerv force-pushed the force_stop branch 4 times, most recently from a2c6293 to da185ec Compare November 17, 2025 09:50
if test_data["returncode"] == -signal.SIGKILL and self._stop_cnt > 1:
self._logger.info("Test killed: %s", test.name)
return

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, we are counting the stop_cnt in two places now. Wouldn't it be a bit more elegant if we had property in the SUT that would be true if we are in the process of stopping it? Then we could do if test_data['returncode'] == -signal.SIGKILL and self._sut.in_shutdown: here instead. What do you think?

Copy link
Collaborator Author

@acerv acerv Nov 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The force in the SUT is done by default. The gracefully stop is done inside the scheduler, where we wait to complete a test/command before stopping the tests execution.

At the moment, the only reason why we have a stop_cnt in two places is because we want to print a session_killed message inside the Session module. I think I will remove this, and keep only session_stopped

Change the way we complete session by introducing forcibly stop. The
way that kirk works after this patch is the following:

- if user sends SIGINT or CTRL+C, we simply wait for the running
tests to complete and finally stop the session

- if user sends SIGINT or CTRL+C again, we stop any execution on the SUT
and we terminate the testing suite, flagging the killed test as TSKIP

Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
Closes: linux-test-project#78
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for a force quit

2 participants