Repository navigation
Conversation
| gArgs.AddArg("-rpcwhitelistdefault", "Sets default behavior for rpc whitelisting. Unless rpcwhitelistdefault is set to 0, if any -rpcwhitelist is set, the rpc server acts as if all rpc users are subject to empty-unless-otherwise-specified whitelists. If rpcwhitelistdefault is set to 1 and no -rpcwhitelist is set, rpc server acts as if all rpc users are subject to empty whitelists.", ArgsManager::ALLOW_BOOL, OptionsCategory::RPC); | ||
| gArgs.AddArg("-rpcworkqueue=<n>", strprintf("Set the depth of the work queue to service RPC calls (default: %d)", DEFAULT_HTTP_WORKQUEUE), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::RPC); | ||
| gArgs.AddArg("-server", "Accept command line and JSON-RPC commands", ArgsManager::ALLOW_ANY, OptionsCategory::RPC); | ||
| gArgs.AddArg("-uniformintervaltest", "Use uniform distribution for random intervals instead of exponential one (default: 0)", ArgsManager::ALLOW_BOOL | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); |
There was a problem hiding this comment.
not sure if adding another mock-setting is the right approach here
- This is not guarded and can accidentally be set on mainnet
- This will run a different code path when set (partially code that has been added for this test-setting only), thus reducing the effectiveness of tests and increasing the maintenance burden
- There is already a way to mock the poisson dist with the noban permission (This could be extracted to a hidden test-only permission if there are concerns about noban being too broad)
- A timeout of 60s with the expected value of the poisson dist (5s or 7s or whatever) yields a failure rate that is far lower than the failure rate we see due to infrastructure problems or other test problems and races. The issue here is that the nodes are daisy chained and thus the delays add up, which could bring the delay over 60s more likely.
There was a problem hiding this comment.
- This is not guarded and can accidentally be set on mainnet
Yes. It must be guarded. Going to fix it.
- This will run a different code path when set (partially code that has been added for this test-setting only), thus reducing the effectiveness of tests and increasing the maintenance burden
The current code path, which is skipped in tests with this PR, is not covered by tests in master.
- There is already a way to mock the poisson dist with the noban permission (This could be extracted to a hidden test-only permission if there are concerns about noban being too broad)
This approach does not work universally, e.g., in wallet_backup.py:
bitcoin/test/functional/wallet_backup.py
Lines 52 to 57 in 40a0481
- A timeout of 60s with the expected value of the poisson dist (5s or 7s or whatever) yields a failure rate that is far lower than the failure rate we see due to infrastructure problems or other test problems and races. The issue here is that the nodes are daisy chained and thus the delays add up, which could bring the delay over 60s more likely.
The assumption about test failures that would be fixed by this PR could be biased as in the most cases we have only CI logs that lack data about infrastructure problems.
There was a problem hiding this comment.
The current code path, which is skipped in tests with this PR, is not covered by tests in master.
The same might be true for this change. Capping the time might never execute code paths (in other functions) that only run after a long timeout.
|
Reworked. @MarcoFalke Mind taking another look? The changes are pretty local, and if they will not justify themselves, they could be easily reverted back 😃 |
|
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. |
|
Rebased c6d1cbd -> 8a945c0 (pr19588.02 -> pr19588.03) to include the recent CI changes. |
These changes fix intermittent timeout errors in the functional tests.
8a945c0 to
b34b8ed
Compare
|
Updated 8a945c0 -> b34b8ed (pr19588.03 -> pr19588.04, diff). Addressed @instagibbs' comment:
|
| int64_t delta_microseconds = -std::log1p(GetRand(1ULL << 48) * -0.0000000000000035527136788 /* -1/2^48 */) * average_interval_microseconds + 0.5; | ||
|
|
||
| // Upper bound to avoid timeouts in the functional tests. | ||
| static const bool regtest = gArgs.GetChainName() == CBaseChainParams::REGTEST; |
There was a problem hiding this comment.
I think this is really ugly, both doing a string compare here, making the function depend on a global, and doing this at first call (which is not guaranteed to be after initializing the chain name).
Though I don't really have a proposal how to do this differently.
Actually, the exponential distribution is unbounded that causes intermittent timeout errors in functional tests.
Fix #18832
Fix #18969
Fix #19265
Fix #19311