You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Perhaps not the worst thing in the world, but when I updated to 0.1.3, I found I was off by a single microsecond in my test.
I was doing something like with fake_time('1970-01-01 00:00:07.012')
and in my test, datetime.now() would end up returning a time that represented 1970-01-01 00:00:07.011999
And later, I am testing a certain time has elapsed, but I would have to account for this single microsecond to be off. I am also plugged in with the latest of these dependencies
These are not all inclusive of everything in my setup, but hopefully of is enough to help identify any issues. Running in a docker environment with the docker container python:3.8.6 and setting up these environment variables within my Dockerfile
A clue maybe: There may be some pytest-xdist conflict issue. Not everyone on my team was seeing this same problem, and we did not have pytest-xdist pinned to a version, so we may have been on different versions. Trying to put everything to the latest version, available today, and I see this issue with the time being off by 1 microsecond.
The text was updated successfully, but these errors were encountered:
The problem exists on both 0.1.2 and 0.1.3, but I don't know that it's a problem with this library, and so not sure where to put this issue. It may be some sort of issue with a certain combination of dependencies. I am not sure. I was updating dependencies to resolve another unrelated issue with our setup. And ran into this issue.
I was talking to someone about this, seems other teams in my org have also run into interesting issues. I thought I would provide info on that initial issue, that had me looking at upgrading. With pytest.xdist[psutil] not pinned in our original setup, Some people were experiencing passing tests, and others, who pulled a more recent version were failing tests.
Any of our tests which were incrementing the time with a call to tick() were not experiencing the time move forward. This was our requirements setup that looked like:
Perhaps not the worst thing in the world, but when I updated to 0.1.3, I found I was off by a single microsecond in my test.
I was doing something like
with fake_time('1970-01-01 00:00:07.012')
and in my test, datetime.now() would end up returning a time that represented 1970-01-01 00:00:07.011999
And later, I am testing a certain time has elapsed, but I would have to account for this single microsecond to be off. I am also plugged in with the latest of these dependencies
pytest-cov==5.0.0
pytest-env==1.1.3
pytest-libfaketime==0.1.2
pytest-mock==3.14.0
pytest==8.2.1
pytest-xdist[psutil]==3.6.1
These are not all inclusive of everything in my setup, but hopefully of is enough to help identify any issues. Running in a docker environment with the docker container python:3.8.6 and setting up these environment variables within my Dockerfile
ENV LD_LIBRARY_PATH="/usr/local/lib/python3.8/site-packages/libfaketime/vendor/libfaketime/src"
ENV LD_PRELOAD="libfaketime.so.1"
ENV DONT_FAKE_MONOTONIC="1"
ENV FAKETIME_DID_REEXEC=true
ENV FAKETIME_NO_CACHE="1"
A clue maybe: There may be some pytest-xdist conflict issue. Not everyone on my team was seeing this same problem, and we did not have pytest-xdist pinned to a version, so we may have been on different versions. Trying to put everything to the latest version, available today, and I see this issue with the time being off by 1 microsecond.
The text was updated successfully, but these errors were encountered: