Skip to content

fix: change the BOOT_TIME_COMMAND for macOS to get higher time precision - #85537

Open
renzibei wants to merge 3 commits into
ansible:develfrom
renzibei:fix/macos_reboot
Open

fix: change the BOOT_TIME_COMMAND for macOS to get higher time precision#85537
renzibei wants to merge 3 commits into
ansible:develfrom
renzibei:fix/macos_reboot

Conversation

@renzibei

Copy link
Copy Markdown
SUMMARY

Fix the issue #85070 "macOS boot time command incorrectly checks boot time if last reboot was at same minute".

Use /usr/sbin/sysctl kern.boottime to replace the who -b for the BOOT_TIME_COMMAND of macOS, to get higher time precision.

ISSUE TYPE
  • Bugfix Pull Request

@ansibot ansibot added bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. labels Jul 24, 2025
Comment thread lib/ansible/plugins/action/reboot.py
renzibei added a commit to renzibei/ansible that referenced this pull request Jul 24, 2025
@webknjaz webknjaz linked an issue Jul 25, 2025 that may be closed by this pull request
1 task
@webknjaz

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@renzibei

Copy link
Copy Markdown
Author

@webknjaz @Akasurde Hi, is there anything needs to be done before merge?

@Akasurde

Copy link
Copy Markdown
Member

@renzibei We are waiting for the Core team triage and will discuss this issue in that meeting. Will update the discussion here.

@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Aug 5, 2025
@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label Aug 7, 2025

@bcoca bcoca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would add a test to ensure we don't regress

@ansibot ansibot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Aug 7, 2025
@ansibot ansibot added stale_review Updates were made after the last review and the last review is more than 7 days old. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Apr 16, 2026
@Akasurde
Akasurde requested a review from bcoca April 16, 2026 19:27
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed stale_review Updates were made after the last review and the last review is more than 7 days old. labels Apr 16, 2026
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Apr 30, 2026

@webknjaz webknjaz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@webknjaz
webknjaz requested a review from s-hertel May 18, 2026 12:15
@webknjaz

Copy link
Copy Markdown
Member

@bcoca do you have a specific test in mind, beyond adjusting the existing one?

@s-hertel

Copy link
Copy Markdown
Contributor

The macOS remote reboots so quickly (~15 seconds; at least 30 seconds faster than last time I checked), so I can reproduce the issue now just by running ansible-test integration reboot --target remote:macos/26.3 a handful of times. By adding another reboot task to test/integration/targets/reboot/tasks/test_standard_scenarios.yml I can reproduce repeatedly:

- name: Reboot yet again in quick succession
  reboot:
  when: ansible_facts.os_family == "Darwin"

Not sure there's a good way to guarantee integration coverage though, since it only occurs if two reboots occur within a minute.

@s-hertel

This comment was marked as resolved.

@azure-pipelines

This comment was marked as resolved.

@ansibot ansibot added pending_ci and removed stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. pending_ci labels May 18, 2026
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug This issue/PR relates to a bug. has_issue needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reboot module: macOS boot time command change

6 participants