wolfcw / libfaketime

libfaketime modifies the system time for a single application
https://github.com/wolfcw/libfaketime
GNU General Public License v2.0
2.74k stars 327 forks source link

accelerating the time doesn't work with python 3.11 #430

Open cyberic99 opened 1 year ago

cyberic99 commented 1 year ago

It works with python 3.10:

$ time faketime -f "+0 x10" python3.10 -c "for i in range(10):import time;print(i);time.sleep(1)"
0
1
2
3
4
5
6
7
8
9

real    0m1.033s
user    0m0.028s
sys 0m0.004s

But not with python 3.11:

$ time faketime -f "+0 x10" python3.11 -c "for i in range(10):import time;print(i);time.sleep(1)"
0
1
2
3
4
5
6
7
8
9

real    0m10.027s
user    0m0.023s
sys 0m0.003s

Tested on archlinux, commit 7154a3f42cd21419a4686c5e9933bf4ba92d13bc

dkg commented 1 year ago

I'm not seeing this problem on debian testing:

0 dkg@alice:~$ time faketime -f "+0 x10" python3.11 -c "for i in range(10):import time;print(i);time.sleep(1)"
0
1
2
3
4
5
6
7
8
9

real    0m1.107s
user    0m0.073s
sys 0m0.033s
0 dkg@alice:~$ dpkg -l faketime python3
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-==================================>
ii  faketime       0.9.10-2.1   amd64        Report faked system time to progra>
ii  python3        3.11.4-5     amd64        interactive high-level object-orie>
0 dkg@alice:~$ 
brianbayer-ic commented 4 months ago

FYI, This is probably the same issue as wolfcw/libfaketime#472 or at least closely related.