Comments (2)
The recommended way would be to set the FAKETIME_NO_CACHE environment variable to 1
os.environ["FAKETIME_NO_CACHE"] = "1"
And then change the content of the FAKETIME environment variable on demand as you do in your code example.
Without disabling the cache, the FAKETIME variable is inspected only every 10 seconds for changes, which is not what you want in your use case. Disabling the cache has a minor performance drawback, but it's unlikely to have a visible impact in your case.
from libfaketime.
Whoops! Thanks.
(When I saw that my test didn't work, I immediately thought "oh, of course, I can't set a a parent's environment from a child process". . .even though that's not even close to what's going on here π )
from libfaketime.
Related Issues (20)
- freeze Browser time HOT 1
- Faketime breaks UTC offsets? HOT 5
- nohup can only works for a while HOT 2
- Build broken with Alpine 3.19 HOT 3
- Java processes with libfaketime do not stop when getting SIGTERM HOT 2
- libfaketime cannot fake std::chrono::system_clock with GCC 4.8.5 HOT 3
- .faketimerc donnot support start at? HOT 2
- Compiling with INTERCEPT_SYSCALL, can only specify time with FAKETIME, not with FAKETIME_TIMESTAMP_FILE HOT 1
- INTERCEPT_SYSCALL does not work with multi threaded and FAKETIME_TIMESTAMP_FILE, but it works with FAKETIME HOT 1
- Reading back a timestamp that was written HOT 3
- How to speed up and synchronize the time of docker containers on the same hostοΌ HOT 14
- libfaketime does not intercept adjtimex system call. HOT 2
- Issue with launching MySQL daemon on UBI8 container with libfaketime (MySQL version 8.2.0)
- NEWS file wasn't updated to 0.9.10
- Feature request: automating FAKETIME_FORCE_MONOTONIC_FIX HOT 2
- Faketime issue with date timezone conversion
- Advanced timestamp format "YYYY-MM-DD hh:mm:ss" with value '1970-01-01 00:00:00 utc' returns 1 instead of 0 very rarely HOT 1
- Unexpected return values from pthread_cond_init_232, pthread_cond_destroy_232, pthread_cond_timedwait HOT 2
- libfaketime build fails on alpine HOT 1
- Nanoseconds support request HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libfaketime.