network_reconnect_resume_test returns weird results on a system that's been running for > 24 hours
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Checkbox |
Fix Released
|
Medium
|
Unassigned |
Bug Description
tested this script on my primary machine which had been up for > 24 hours. I got surprising results:
bladernr@
./scripts/
Your Wifi Resumed in -89511.28 seconds after the last suspend
PASS: the network connected within the allotted time specified
I this machine has a few wifi reconnects in dmesg and it's doing the check for wifi_resume__time >= resume_time and immediately returning results for the first match. On my system, after multiple starts and stops of wifi, that causes it to return the very first instance, which is indeed 89511 seconds BEFORE the current time.
Here's an output after I added some instrumentation:
bladernr@
./scripts/
RESUME TIME: 109865.699154
RECONNECT TIMES: [' 31.658051', '20354.420357', '96320.460391',
'109880.553268']
Checking reconnect time 31.658051
Checking reconnect time 20354.420357
wifi_reconnect_time is >= resume_time
Your Wifi Resumed in -89511.28 seconds after the last suspend
PASS: the network connected within the allotted time specified
as you can see with the contents of wifi_reconnect_
It appears that Python things that 20354.420357 is a larger number than 109865.699154
Looking further, it is because this is due to how the numbers are derived. The times are timestamps pulled from dmesg, and they are presented as text rather than floats. this is confirmed by replicating the behaviour in a python shell:
In [1]: time1 = 109865.699154
In [2]: time2 = 20354.420357
In [3]: time2 >= time1
Out[3]: False
In [4]: time1 >= time2
Out[4]: True
In [5]: time1 = '109865.699154'
In [6]: time2 = '20354.420357'
In [7]: time1 >= time2
Out[7]: False
In [8]: time2 >= time1
Out[8]: True
When the numbers are set as strings, time2 is indeed greater than or equal to time1. not so when they are assigned as floats.
Related branches
- Daniel Manrique (community): Approve
-
Diff: 1477 lines (+506/-529) (has conflicts)1 file modifieddebian/changelog (+506/-529)
summary: |
- wifi_reconnect_resume_test returns weird results on a system that's been - running for > 24 hours + network_reconnect_resume_test returns weird results on a system that's + been running for > 24 hours |
No such script exists in Checkbox, unless I've gone blind/crazy