Repository navigation
Closed
Description
log excerpt
177/244 - wallet_encryption.py --descriptors failed, Duration: 6 s
stdout:
2022-06-27T07:50:03.095000Z TestFramework (INFO): Initializing test directory C:\Users\ContainerAdministrator\AppData\Local\Temp\test_runner_₿_🏃_20220627_071202\wallet_encryption_65
2022-06-27T07:50:08.820000Z TestFramework (INFO): Check a timeout less than the limit
2022-06-27T07:50:09.007000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
File "C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build\test\functional\test_framework\test_framework.py", line 133, in main
self.run_test()
File "C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build\test\functional\wallet_encryption.py", line 85, in run_test
assert_greater_than(expected_time_with_buffer, actual_time)
File "C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build\test\functional\test_framework\util.py", line 56, in assert_greater_than
raise AssertionError("%s <= %s" % (str(thing1), str(thing2)))
AssertionError: 1756315608.992383 <= 1756315609
2022-06-27T07:50:09.070000Z TestFramework (INFO): Stopping nodes
2022-06-27T07:50:09.211000Z TestFramework (WARNING): Not cleaning up dir C:\Users\ContainerAdministrator\AppData\Local\Temp\test_runner_₿_🏃_20220627_071202\wallet_encryption_65
2022-06-27T07:50:09.211000Z TestFramework (ERROR): Test failed. Test logging available at C:\Users\ContainerAdministrator\AppData\Local\Temp\test_runner_₿_🏃_20220627_071202\wallet_encryption_65/test_framework.log
2022-06-27T07:50:09.211000Z TestFramework (ERROR):
2022-06-27T07:50:09.211000Z TestFramework (ERROR): Hint: Call C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build\test\functional\combine_logs.py 'C:\Users\ContainerAdministrator\AppData\Local\Temp\test_runner_₿_🏃_20220627_071202\wallet_encryption_65' to consolidate all logs
2022-06-27T07:50:09.211000Z TestFramework (ERROR):
2022-06-27T07:50:09.211000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2022-06-27T07:50:09.211000Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
2022-06-27T07:50:09.211000Z TestFramework (ERROR):
Activity
maflcko commentedon Jul 4, 2022
See #25021
saranshisatgit commentedon Jul 7, 2022
Couldn't reproduce locally, ran just fine on Mac OS M1
mzumsande commentedon Aug 1, 2022
I could reproduce this locally on my laptop: Windows 10, V21H2, built with MS Visual Studio Community 2022 V17.2.6, Python 3.10.5.
The test failed for me 6 times over 1000 runs. I'll try to investigate further.
maflcko commentedon Aug 2, 2022
Nice, can you try if this was caused by 0000a63 (switch from time() -> std::chrono)?
maflcko commentedon Aug 2, 2022
Also, you might be able to reproduce more often if you determine the duration of the rpc and try to delay the test so that it more often ends in the "bug range" of ".99":
while time.time() % 1 < 0.98 - rpc_dur : passmzumsande commentedon Aug 2, 2022
Great idea, that worked to make it fail more often.
I did this by reintroducing the old code as
int64_t GetTimeLegacy()on top of master and when I use it inencrypt.cppinstead of the newGetTime()the test didn't fail anymore.Then I logged both
GetTime()andGetTimeLegacy()at this spot, and confirmed thatGetTime(), although executed first, is bigger by 1 in runs where the test fails.So it does seem that on msvc, the
std::chronotime deviates slightly fromtime()(by~0.005s) - and the python clock, which seems to coincide withtime().maflcko commentedon Aug 3, 2022
That's both shocking and funny. 🥲
cc @sipsorcery
To clarify, the following code would print a negative value?
mzumsande commentedon Aug 3, 2022
No, it prints a (small) positive value. Since the
std::chronotime is larger thantime(), this is expected?maflcko commentedon Aug 3, 2022
I guess I got it backward. So the following would print -1s, instead of a small negative value, or 0?
(Edit: Needs C++20)
mzumsande commentedon Aug 3, 2022
It prints
-10000000[1/10000000]sI'd assume that's equivalent to -1s, if I instead use
std::chrono::seconds(end) - FloorS(run)in the cout statement, it actually prints-1s.maflcko commentedon Aug 3, 2022
I was thinking that this could be fixed by translating the
time_ttime tostd::chronotime withfrom_time_t, but no success. Funnily, on godbolt msvc is "fine", but gcc and clang "fail": https://godbolt.org/z/dT8r3n911 .Locally on my Linux the clocks are off by 1 millisecond.
maflcko commentedon Aug 4, 2022
For the functional tests on Linux, it doesn't matter that there is an offset between
time_tandstd::chrono, because (at least on my machine) both Pythontime.time(), as well asstd::chronouseclock_gettime, see https://github.com/python/cpython/blame/621b33ce258f3eaf154322c1edf0ead1e4892e36/Python/pytime.c#L896On Windows, Python
time.time()usesGetSystemTimeAsFileTime, see https://github.com/python/cpython/blame/621b33ce258f3eaf154322c1edf0ead1e4892e36/Python/pytime.c#L856 . Does anyone know whatstd::chronoon Windows uses?maflcko commentedon Aug 4, 2022
Probably using the same as python:
maflcko commentedon Aug 19, 2022
Cleared milestone for now. While this is a regression for 24.0, I don't think anyone has figured out why or how to fix it. The underlying bug shouldn't lead to consensus failure or other user facing bugs, so it seems fine to ship 24.0 with this "bug".
Merge bitcoin#25878: tests: Use mocktime for wallet encryption timeout