Skip to content

Commit dcf1181

Browse files
committed
fix(test/boottime): allow decimal values in regex
Update the regex to support decimal values for kernel and userspace timings from systemd-analyze. In the PCI pipeline the test is failing with IndexError because the line to match is "Startup finished in 130ms (kernel) + 1.006s (userspace) = 1.136s". Signed-off-by: Riccardo Mancini <[email protected]>
1 parent 343b0ab commit dcf1181

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/integration_tests/performance/test_boottime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def get_systemd_analyze_times(microvm):
7575
# The line will look like this:
7676
# Startup finished in 79ms (kernel) + 231ms (userspace) = 310ms
7777
# In the regex we capture the time and the unit for kernel, userspace and total values
78-
pattern = r"Startup finished in (\d*)(ms|s)\s+\(kernel\) \+ (\d*)(ms|s)\s+\(userspace\) = ([\d.]*)(ms|s)\s*"
78+
pattern = r"Startup finished in ([\d.]*)(ms|s)\s+\(kernel\) \+ ([\d.]*)(ms|s)\s+\(userspace\) = ([\d.]*)(ms|s)\s*"
7979
kernel, kernel_unit, userspace, userspace_unit, total, total_unit = re.findall(
8080
pattern, boot_line
8181
)[0]

0 commit comments

Comments
 (0)