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

Fix LP tests filters check and add to smoke tests in CI #11649

Merged
merged 39 commits into from
Jan 23, 2024

Conversation

Tofel
Copy link
Contributor

@Tofel Tofel commented Dec 21, 2023

FIxes 3 issues:

  • invalid check whether CL node has all expected filters (thanks to @reductionista)
  • invalid iteration over filters to be registered per upkeep and contract (thanks @reductionista)
  • invalid listening circuit breaker logic for log emission

It also adds a couple of sanity checks to make sure that:

  • all upkeep ids are unique
  • all contract addresses are unique
  • all registered filters are unique

Last, but not least I've simplified log await logic (basically query logs from a huge range and repeat until success or timeout) and added LP tests to our integration tests job that runs on each commit.

Once it's merged #11649 can be closed.

…me sanity checks, add 3 log poller tests to integration pipeline
Copy link
Contributor

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

@Tofel Tofel changed the title Lp tests final fix and ci Fix LP tests filters check and add to smoke tests in CI Dec 21, 2023
@Tofel Tofel marked this pull request as ready for review December 21, 2023 19:31
@Tofel Tofel requested a review from a team as a code owner December 21, 2023 19:31
@Tofel Tofel requested a review from reductionista December 21, 2023 19:31
@@ -369,6 +369,24 @@ jobs:
nodes: 1
os: ubuntu-latest
pyroscope_env: ci-smoke-forwarder-ocr-evm-simulated
- name: log-poller-finality-tag
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two questions:

  1. Is it possible to run these tests in parallel?
  2. If the answer to the above is no then do we think we will need to add more log poller tests? We have a setup using json files to handle test files with multiple docker based tests that helps us notice when a new test is added but not added to CI with that. With only 3 tests it might be overkill to move to that but if we are going to be adding any more we might want to go that route.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. in parallel as in a separate job that runs parallel to this one? I think it should be, but unless we decide we want to run all 6 smoke tests not just 3 of them, then imho it's not needed.
  2. @reductionista do you think it makes sense to run 3 tests we have (regular one, replay, chaos) for both fixed and finality tag versions or it's enough if we run any of these 3 tests with fixed depth and rest with finality tag?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see much point in running any of these tests in CI yet until we add a way to disable backup logpoller in config. I guess we can run them, but we may get a lot of false positives.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think once we are ready to run all of them, we should probably run all 6... because there could be different bugs with fixed depth and finality tag for any of those situations

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the end I did what you suggested, @tateexon
image

@reductionista I think it's better to run them even if they are not testing LP in isolation, because backup poller is covering whatever issues we might have, we might still catch something.

@reductionista
Copy link
Contributor

Have we tested this to make sure it passes with backup logpoller disabled? Right now, we can only do that manually, so the CI test will have a lot of false positives. But I'll try and make it configurable soon, so we can disable it in CI during these tests as well.

@Tofel
Copy link
Contributor Author

Tofel commented Dec 22, 2023

Have we tested this to make sure it passes with backup logpoller disabled? Right now, we can only do that manually, so the CI test will have a lot of false positives. But I'll try and make it configurable soon, so we can disable it in CI during these tests as well.

@reductionista I did not, do I assume correctly that this should do the trick of disabling backup poller sufficiently?

			// If pollPeriod is set to 1 block time, backup log poller will run once every 100 blocks
			const backupPollerBlockDelay = 10000

@Tofel Tofel requested a review from connorwstein as a code owner December 22, 2023 13:48
@Tofel
Copy link
Contributor Author

Tofel commented Dec 22, 2023

DO NOT MERGE UNITL I REMOVE INCREASED BACKUP POLLER TICK INTERVAL

@Tofel
Copy link
Contributor Author

Tofel commented Dec 22, 2023

@reductionista so... there's a situation, when one tests still fails reliably with backup poller disabled and that's chaos test, in case when it pauses postgres db container during log emission. Some logs might get lost in that case. If backup poller is running they are later correctly processed. When it's not, the test fails. I didn't have time yet to look at node logs to see what's happening there.

@reductionista
Copy link
Contributor

Have we tested this to make sure it passes with backup logpoller disabled? Right now, we can only do that manually, so the CI test will have a lot of false positives. But I'll try and make it configurable soon, so we can disable it in CI during these tests as well.

@reductionista I did not, do I assume correctly that this should do the trick of disabling backup poller sufficiently?

			// If pollPeriod is set to 1 block time, backup log poller will run once every 100 blocks
			const backupPollerBlockDelay = 10000

Doing that it will still run once at the very beginning. I'm not sure if that's a problem, as it would likely just do nothing and happen before the tests actually get started. But just in case I've been doing it like this... so that it will never run:

-	backupLogPollTick := time.After(100 * time.Millisecond)
+  backupLogPollTick := time.After(100 * time.Hour)

@Tofel Tofel requested a review from a team as a code owner January 23, 2024 21:09
@@ -328,7 +328,7 @@ jobs:
run: -run TestOCRJobReplacement
file: ocr
pyroscope_env: ci-smoke-ocr-evm-simulated
- name: ocr2
- name: ocr2-replacement
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this break the run? I thought names were used to help determine files?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, smoke tests pass, no? ;-)

@@ -12,11 +12,13 @@ import (
"testing"
"time"

"cosmossdk.io/errors"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to use the standard errors instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already removed :-)

.github/workflows/integration-tests.yml Outdated Show resolved Hide resolved
.github/workflows/integration-tests.yml Outdated Show resolved Hide resolved
@cl-sonarqube-production
Copy link

SonarQube Quality Gate

Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@ilija42 ilija42 added this pull request to the merge queue Jan 23, 2024
Merged via the queue into develop with commit 139fb1a Jan 23, 2024
94 checks passed
@ilija42 ilija42 deleted the lp_tests_final_fix_and_ci branch January 23, 2024 22:39
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.

6 participants