Process is blocked when using file approach with the dotnet process
We want to use the library in our test base on MSTest/ReqNRoll. We are starting the test by "dotnet test <OurTest.dll>" in containers running linux and during the tests we are altering the time to cover certain scenarios.
We saw the following behavior:
Using the environment variable FAKETIME is working to set an initial time, but adapting of the time is not changing the time in the running process.
Using the library over the file approach (Using .faketimerc, /etc/faketimerc or a custom file set by FAKETIME_TIMESTAMP_FILE):
- When starting the process with an existing file is blocking the process start and the process is blocked forever
- When creating a file during runtime has no influence on the process time
Is there anything we missed or a different approach we can follow?
I have the same issue, a solution for this would be nice.
Please try using the file-based mechanism for other processes to make sure it basically works on your system and only fails with dotnet. I don't know how libfaketime could lock up during accessing its configuration file unless dotnet somehow influences standard filesystem access. It would be good to know then whether it really just hangs or goes into some kind of loop; in either case, it might be hard to fix this on libfaketime's end. If you cannot influence the value of the environment variable at run-time and the file-based approach does not work, you'll probably have to control libfaketime via its shared memory, which is the most low-level and least comfortable way.
We used the file-based mechanism and it worked with other processes, but as soon as we use the dotnet process it is not working.