gh-151929: Get boot identifier and uptime in test.pythoninfo#152127
Conversation
|
Example of GitHub Action CI jobs logging the 3 keys (boot_id, machine_id, uptime):
Android (x86_64) logs boot_id and uptime:
|
Oh, it got two network erros: and |
|
Draft code to get the uptime of a Linux container: import time
import datetime
import os
jiffies = os.sysconf("SC_CLK_TCK")
with open("/proc/1/stat") as fp:
line = fp.readline()
line = line.rpartition(')')[-1]
parts = line.split()
start_time = int(parts[22 - 3])
seconds = start_time / jiffies
uptime = time.clock_gettime(time.CLOCK_BOOTTIME)
print(str(datetime.timedelta(seconds=uptime - seconds))) |
|
"Emscripten / build and test" logs only the machine_id: |
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15. |
|
GH-152134 is a backport of this pull request to the 3.15 branch. |
|
Sorry, @vstinner, I could not cleanly backport this to |
|
GH-152135 is a backport of this pull request to the 3.14 branch. |
|
GH-152137 is a backport of this pull request to the 3.13 branch. |
|
Oh, I'm surprised FreeBSD logs the uptime and the machine_id! It seems like the |
Uh oh!
There was an error while loading. Please reload this page.