libfaketime | libfaketime modifies the system time for a single application | Date Time Utils library
kandi X-RAY | libfaketime Summary
kandi X-RAY | libfaketime Summary
Usage a) Basics b) Using absolute dates c) Using start at dates d) Using offsets for relative dates e) Advanced features and caveats f) Faking the date and time system-wide g) Using the "faketime" wrapper script h) "Limiting" libfaketime based on elapsed time or number of calls. Running "make" compiles both library versions and a test program, which it then also executes. If the test works fine, you should copy the libfaketime libraries (libfaketime.so.1, and libfaketimeMT.so.1) to the place you want them in. Running "make install" will attempt to place them in /usr/local/lib/faketime and will install the wrapper shell script "faketime" in /usr/local/bin, both of which most likely will require root privileges. However, from a technical point of view, there is no necessity for a system-wide installation, so you can use libfaketime also on machines where you do not have root privileges. You may want to adjust the PREFIX variable in the Makefiles accordingly. By default, the Makefile compiles/links libfaketime for your default system architecture. If you need to build, e.g., 32-bit files on a 64-bit platform, please see the notes about CFLAGS and LDFLAGS in src/Makefile. Since version 0.6, system calls to file timestamps are also intercepted, thanks to a contribution by Philipp Hachtmann. This is especially useful in combination with relative time offsets as explained in section 4d) below, if a program writes and reads files whose timestamps also shall be faked. If you do not need this feature or if it confuses the application you want to use FTPL with, define the environment variable NO_FAKE_STAT, and the intercepted stat calls will be passed through unaltered. On macOS, it is necessary to compile differently, due to the different behavior dyld has. Use the Makefile.OSX file provided to compile libfaketime.1.dylib. Additionally, instead of using LD_PRELOAD, the variable DYLD_INSERT_LIBRARIES should be set to the path to libfaketime.1.dylib, and the variable DYLD_FORCE_FLAT_NAMESPACE should be set (to anything). macOS users should read README.OSX for additional details.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of libfaketime
libfaketime Key Features
libfaketime Examples and Code Snippets
Community Discussions
Trending Discussions on libfaketime
QUESTION
At work I am transitioning a system from an older version of Python, and as a part of that I need to upgrade gevent
to version 21.1.2.
Some of our tests use libfaketime.fake_time
and time.sleep
in the code being tested. However, with the new gevent
version these sleeps sleep forever, probably because time doesn't change. The time
module does get patched.
Is there a way to make it sleep for the required period of time and then wake up?
...ANSWER
Answered 2021-Jun-04 at 20:57Use gevent.sleep
not time.sleep
. You can always wrap anything around a Timeout
as well:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install libfaketime
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page