Skip to content

Improved logging in restart/reboot context - #5165

Open
happz wants to merge 3 commits into
mainfrom
reboot-restart-context-logging
Open

happz wants to merge 3 commits into
mainfrom
reboot-restart-context-logging

Conversation

@happz

@happz happz commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Pull Request Checklist

  • implement the feature

@happz
happz added this pull request to stack #5166 September 15, 2026 21:02
@happz happz added ci | full test Pull request is ready for the full test execution code | logging Changes related to debug logging labels Sep 15, 2026
@happz happz added this to planning Sep 15, 2026
@github-project-automation github-project-automation Bot moved this to backlog in planning Sep 15, 2026
@happz happz moved this from backlog to implement in planning Sep 15, 2026
@happz happz moved this from implement to review in planning Sep 17, 2026
@therazix
therazix force-pushed the reboot-restart-context-logging branch from efab317 to 2746aff Compare September 17, 2026 13:03
Comment on lines +101 to +112
if reboot:
self.logger.debug(
f"Restart during {self.owner_label}"
f" with reboot count {reboot.reboot_counter}"
f" and restart count {self.restart_counter}."
)

else:
self.logger.debug(
f"Restart during {self.owner_label} with restart count {self.restart_counter}."
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

With this section moved above the

        else:
            self.restart_counter += 1

there is now discrepancy between the debug messages WRT to counters:
main:

Hard reboot during test '/tests/mujtest/restart-with-reboot-test' with reboot count 1 and test restart count 1.
Hard reboot using the testcloud API.
Triggering hard reboot with '<function GuestTestcloud.reboot.<locals>.<lambda> at 0x7f8a8dce1f30>'.
wait: waiting for condition '<lambda>' with timeout 0:10:00, deadline in 600.0 seconds, checking every 30.00 seconds <Deadline: now=345535.365870988 deadline=346135.365870988>
Execute command 'export PYTEST='python3 -m pytest -vvv -ra --showlocals'; export TMT_VERSION=1.78.0; export TMT_TREE=/var/tmp/tmt/run-075/plans/mujplan/mujplan/tree; export TMT_PLAN_DATA=/var/tmp/tmt/run-075/plans/mujplan/mujplan/data; export TMT_PLAN_SOURCE_SCRIPT=/var/tmp/tmt/run-075/plans/mujplan/mujplan/data/plan-source-script.sh; export TMT_PLAN_ENVIRONMENT_FILE=/var/tmp/tmt/run-075/plans/mujplan/mujplan/data/variables.env-default-0; cat /proc/stat' on guest '127.0.0.1'.
wait: '<lambda>' finished successfully, 583.44 seconds left <Deadline: now=345551.922380612 deadline=346135.365870988>
Connection to guest succeeded after reboot.
Test restart during test '/tests/mujtest/restart-with-reboot-test' with reboot count 1 and restart count 1.

PR:

Restart during test '/tests/mujtest/restart-with-reboot-test' with reboot count 0 and restart count 0.
Hard reboot during test '/tests/mujtest/restart-with-reboot-test' with reboot count 1 and restart count 1.

is this intended?

Base automatically changed from ssh-master-process-whoami to main September 18, 2026 19:55
Restart context did log, but after many steps it already took. Therefore
there were several actions in the log taken on behalf of the restart
context, just without the context announcing it would apply.

Reboot context speaks about "test" but it's no longer test-only.
@therazix
therazix force-pushed the reboot-restart-context-logging branch from 2746aff to 2c7b762 Compare September 18, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci | full test Pull request is ready for the full test execution code | logging Changes related to debug logging

Projects

Status: review

Development

Successfully merging this pull request may close these issues.

3 participants