Repository navigation
Conversation
f6cd3e2 to
d47f02b
Compare
|
Strange that this happens twice in a day suddenly, without any recent changes that look related. The linked CI runs fail at different subtests, one at ("Check a timeout less than the limit") and one at ("Check a timeout greater than the limit") - so a fix should probably also affect both. |
|
I can't see how this would happen unless the python clock is ahead of the system clock?? |
d47f02b to
f446ea6
Compare
|
Yeah, it's weird. Win64-only so far. Let's see if there are more failures. Thanks @mzumsande, re-pushed with a smaller additional margin for both tests. |
f446ea6 to
aa26dfd
Compare
|
Another one: https://cirrus-ci.com/task/4631236957175808 |
|
I think a possible explanation would be if the
So, we end up with actual time (11 + MAX) < expected with buffer (10.7 + MAX). If this guess is correct, then the following should fix it: before = math.floor(time.time()) + MAX_VALUE
self.nodes[0].walletpassphrase(passphrase2, MAX_VALUE + 1000)
after = math.ceil(time.time()) + MAX_VALUE
actual = self.nodes[0].getwalletinfo()['unlocked_until']
assert_greater_than_or_equal(actual, before)
assert_greater_than_or_equal(after, actual) |
aa26dfd to
76f8dc9
Compare
|
@vasild done (thanks for looking into this) and added a commit for test logging (and named args and an assertion). |
vasild
left a comment
There was a problem hiding this comment.
ACK 76f8dc9bd1b4efd543dc54c17a5f8e9d512580e1
76f8dc9 to
1a82609
Compare
|
Is this still an issue? I haven't seen it recently. |
|
Haven't seen it in a week. Could drop the fix for now and leave the improvements. |
|
Just saw this error: https://cirrus-ci.com/task/4948737314258944?logs=functional_tests#L25 in #24230 Log: |
|
Ok, then I think we should only maim the test on windows, not on all platforms. |
Sure, "maim" is a bit too strong. It is making the test lax by up to another second, while no one understands why. |
|
Would be nice if someone could run this on msvc: #include <iostream>
#include <chrono>
#include <string>
template <typename TimePoint>
std::string to_string(const TimePoint& time_point)
{
return std::to_string(time_point.time_since_epoch().count());
}
int main()
{
using namespace std::literals::chrono_literals;
using Sec = std::chrono::seconds;
std::cout << "Time point\t" "Cast\t" "Floor\t" "Round\t" "Ceil\n";
std::cout << "(ms)\t\t" "(s)\t" "(s)\t" "(s)\t" "(s)\n";
for (const auto value_ms: {5432ms, 5678ms}) {
std::chrono::time_point<std::chrono::system_clock, std::chrono::milliseconds>
time_point_ms(value_ms);
std::cout
<< to_string(time_point_ms) << "\t\t"
<< to_string(std::chrono::time_point_cast<Sec>(time_point_ms)) << "\t"
<< to_string(std::chrono::floor <Sec>(time_point_ms)) << "\t"
<< to_string(std::chrono::round <Sec>(time_point_ms)) << "\t"
<< to_string(std::chrono::ceil <Sec>(time_point_ms)) << "\n";
}
}From https://en.cppreference.com/w/cpp/chrono/time_point/ceil. Should print: |
That is true, but the point of the test is to ensure that the time limit is honored - 1. cannot be negative, 2. is capped at some limit and 3. if within the limits, then is accepted. The original test in 134cdc7 contained 5 seconds buffer, so the point of the test is not to check that the value is accepted up to the second, exactly. |
|
I haven't seen it yet, so it indeed seems like a bug in Windows 2019 |
|
Seems this won't be merged. |
|
The reason I haven't merged this yet is that it has only one ACK, but outstanding review comments such as #25021 (comment) and #25021 (comment) Also, I am not sure if a test fix should modify the cpp source code. No objection to those changes, but maybe try to submit them separate from a test fix? |
|
The reason for closing - "this won't be merged" seems unjustified to me. If Marco did not merge it in the past, that does not mean he will not merge it in the future. Or that another maintainer will not merge it in the future. Indeed it has just one ACK. @achow101, maybe you can review this, since you are the original author of the tests. I think this PR should be reopened, IMO it is an improvement even if it does not fix the mysterious test failures. |
|
For reference, I created #25750 two weeks ago |
Ok, re-opening. Note also that many test changes (and regular codebase ones, #25656 would be an example merged today) are merged with one ACK, so this doesn't seem to be a hard rule. |
I'm happy to update this PR with suggestions for improvements or a different approach. |
Co-authored-by: Vasil Dimov <[email protected]>
note: using std::min here shouldn't add to the compilation time of src/wallet/rpc/encrypt.cpp, as src/wallet/wallet.h that it depends on already includes the algorithm library. Also added this file to the clang-tidy include-what-you-use CI script and updated the headers.
1a82609 to
189f57b
Compare
|
Updated to improve assertion error, changed the first commit message from "fix" to "work around" and rebased to current master to enable clang-tidy iwyu checks on the second commit (will re-push after the clang-tidy CI run). Happy to split out the some of changes to a separate pull or to update the approach if reviewers prefer. |
|
Has this been is addressed? If yes, can you mark it as resolved, if not, can you comment?
If this is now a work around, rather than a fix, I'd rather use the work-around that is contained to the platform that is broken, i.e #25750, rather than refactoring code that works for all other platforms, and essentially hiding the bug on Windows. At least until we properly understand the issue; see debugging in #25482. The PR title and description need updating in any case. |
|
Can you explain why the workaround here is better than the one in #25750? |
|
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. |
|
It seems like instead of messing around with buffers and relaxing ranges, this could just be resolved through the use of mock time so that bitcoind is set to a fixed time. |
|
I'll give that a shot 👍 |
|
For reference, I suggested mocktime in May: #25021 (comment) This should be fine to do here, as the time returned has no guarantee to be related to the real relock time, which happens completely independent in the libevent scheduler thread. |
Uh oh!
There was an error while loading. Please reload this page.