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

Further harden NATS test, accept duplicate deliveries and out-of-order better #4392

Merged
merged 4 commits into from
Sep 9, 2024

Conversation

evankanderson
Copy link
Member

Summary

It looks like the NATS tests would sometimes time out or have other issues under the "Coverage" legs (but not elsewhere).

Running go test -race -cover -count 200 ./internal/events/nats I was able to find a few more failing cases and terminate them with prejudice.

Change Type

Mark the type of change your PR introduces:

  • Bug fix (resolves an issue without affecting existing features)
  • Feature (adds new functionality without breaking changes)
  • Breaking change (may impact existing functionalities or require documentation updates)
  • Documentation (updates or additions to documentation)
  • Refactoring or test improvements (no bug fixes or new functionality)

Testing

go test -race -cover -count 200 ./internal/events/nats

Review Checklist:

  • Reviewed my own code for quality and clarity.
  • Added comments to complex or tricky code sections.
  • Updated any affected documentation.
  • Included tests that validate the fix or feature.
  • Checked that related changes are merged.

Comment on lines +102 to +104
case <-time.After(25 * time.Second):
t.Logf("timeout waiting for message %d", i)
break loop
Copy link
Member Author

Choose a reason for hiding this comment

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

Using a Fatal here means that if we don't get redeliveries, we may error out on the tests. I'm not sure why I didn't see this locally, but did see this on CI. CI is correct.

@coveralls
Copy link

Coverage Status

coverage: 53.241% (-0.4%) from 53.661%
when pulling dd900c4 on evankanderson:really-fix-nats-test
into 7d6a2e0 on stacklok:main.

@evankanderson evankanderson merged commit 44d1523 into mindersec:main Sep 9, 2024
21 checks passed
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.

4 participants