-
Notifications
You must be signed in to change notification settings - Fork 873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RenamingABranchIncludesTheCorrectReflogEntries occasionally fails the range check #1186
Comments
😿 We've tried to improve this situation with #999 but your issue hints at the fact that this doesn't solve the issue. Are you seeing this behavior while running the tests from the tip of Would you have a proposal for a different (and more successful approach), we'd be very interested. |
I'm seeing this behaviour on the tip of my branch which is up for the mentioned PR... The tests have not changed in the two commits since the tip of A quick-n-dirty fix may be to just add a second of tolerance, iow. specifying the "from" as 1 second before the actually determined time, but that's really really dirty. |
I wonder where the difference is coming from (2 different mechanisms to get the current time that disagree? maybe there is an issue in our |
Am I correct in remembering that ref-logging is now handled internal to libgit2? Can we just subtract a second from |
@carlosmn I can't remember, where does the reflog timestamp come from? |
When writing the reflog entry, we either take whatever the user has passed in, or we create a new signature from the repository's configuration with the current timestamp. But wall-clock time is weird on computers, and it may go backwards depending on how/who you ask, how recently ntp ran and the current temperature. While it is somewhat unexpected that the timestamp is before the range, it's not that odd considering libgit2 is asking |
One thing I've noticed is that we try to truncate the milliseconds by substracting the leftover ticks per second, but |
@carlosmn I've tried this before, but hit an issue. Removing the elapsed milliseconds keeps some remaining ticks (that do not total to a whole millisecond) and doesn't generate a properly truncated |
Occasionally it happens to me that the Branch Renaming reflog test fails with following error message
It seems the range's From is off by a second. This behaviour appears only sporadically. As of now I only reproduced this on Ubuntu with Mono-4.0.0.0
The behaviour shows both when running the XUnit Tests from mondevelop as well as when running
build.libgit2sharp.sh
, but usually disappears when rerunning the testBehaviour was noticed when working on #1185
The text was updated successfully, but these errors were encountered: