Skip to content
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

Allow customizing BackupPollerDelayBlock or disabling Backup LogPoller entirely for tests #11850

Merged
merged 11 commits into from
Feb 28, 2024

Conversation

reductionista
Copy link
Contributor

Previously, backupPollerBlockDelay was defined as a const in LogPoller and hard-coded to 100. Now, any value can be passed to the LogPoller constructor including 0 to disable Backup LogPoller entirely.

Also, the number of params passed to NewLogPoller() has been gradually getting out of control, so this is a good opportunity to move them into a logpoller.Opts struct. This simplifies many of the LogPoller test setups, allowing for the omission of default parameters and less duplication of code

The main motivation for this: some fairly sophisticated scale tests have been added for LogPoller under integration-tests, but presently they can give false negatives due to Backup Poller. (ie, most failures of regular LogPoller would go unnoticed because Backup LogPoller will automatically fix things as an emergency fallback. These tests don't look at timing issues, only correctness, so they cannot distinguish between a temporary failure for a short period and no failure). The only way we can obtain reliable results for these tests presently is to temporarily comment out the part that calls BackupPoller in the code. This adds a way to disable it in a test, so we can run them in an automated way and trust the results.

Copy link
Contributor

I see that you haven't updated any CHANGELOG files. Would it make sense to do so?

samsondav
samsondav previously approved these changes Jan 23, 2024
@reductionista reductionista marked this pull request as ready for review January 24, 2024 02:15
reductionista and others added 11 commits February 27, 2024 21:14
This failing chainreader test had FinalityDepth set to 0, so LogPoller was starting after
the block where the logs were emitted. It was only passing due to
Backup LogPoller.  With Backup LogPoller disabled, we have to increase
the finality depth so that LogPoller will start a few blocks back (at
the first unfinalized block).

The failing logpoller test was looking for an extra log entry emitted by BackupLogPoller.
Now we can run it with BackupLogPoller disabled (leading to a more robust test) and stop
looking for that
@reductionista reductionista added this pull request to the merge queue Feb 28, 2024
Merged via the queue into develop with commit 014e842 Feb 28, 2024
97 checks passed
@reductionista reductionista deleted the BCF-2835-disable-backup-lp branch February 28, 2024 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants