Repository navigation
Conversation
fa83b98 to
faa2df9
Compare
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
3271c78 to
faa2df9
Compare
| # Calculate the expected timeout after the walletpassphrase call, since | ||
| # it iterates over all encrypted keys | ||
| expected_time_with_buffer = time.time() + MAX_VALUE - 600 | ||
| if sys.platform == "win32": |
There was a problem hiding this comment.
From the discussion in #25482 (comment) it seems that time() and std::chrono can deviate a bit on both Windows and Linux and that is the root of the problem. We only observe a problem on Windows because it happens that Python's time.time() uses one on Windows and the other on Linux. But we are not guaranteed that it will be like that forever. E.g. future Python on Linux may start to behave as the Python on Windows.
Is the above correct? If yes, then it would be better to fix this test in platform agnostic way.
There was a problem hiding this comment.
No, I still fail to see how this bug exits in the first place.
We know:
- It has only been observed on Windows MSVC, after commit 0000a63
- It has never been observed on any other OS or a different compiler. Though, that doesn't mean the bug doesn't exist on Windows with clang or gcc, or on Linux with a different setting.
- After commit 0000a63, both python
time.time()and MSVCstd::chronouse the same source for time (precise file time). So commit 0000a63 should have fixed the issue (if it existed before), not introduce it - The issue shouldn't be reproducible on systems where
time()is behindstd::chrono::system_clock. I've observed thetime()to be behind by usually 1/2/6 ms on Linux. While this lag wouldn't lead to any test failues, commit 0000a63 removed the lag on Linux.
ryanofsky
left a comment
There was a problem hiding this comment.
Code review ACK faa2df9. Agree with Marco it is probably good to limit the check to win32 if we don't know cause of the problem yet.
One speculation about the cause: maybe this is a rounding bug? int(time.time()) will round the expected_time_with_buffer value down in python, while it's not clear from https://en.cppreference.com/w/cpp/chrono/time_point/time_point_cast if the c++ code necessarily will truncate
I don't think so. floor and cast do the same thing, see #25021 (comment) |
The test passes on all platforms, such as freebsd, linux, or macos. However, it does not pass on Windows. Temporarily relax it on Windows to avoid wasting resources on manually triggered CI re-runs. The workaround can be reverted when the issue is understood and fixed.