-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
core/capabilities/ccip/ccip_integration_tests/ccipreader: close logpoller in testSetup() #15335
Conversation
…ller in testSetup()
@@ -797,6 +798,7 @@ func testSetup( | |||
lggr := logger.TestLogger(t) | |||
lggr.SetLogLevel(zapcore.ErrorLevel) | |||
db := pgtest.NewSqlxDB(t) | |||
t.Cleanup(func() { assert.NoError(t, db.Close()) }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is important to register defer/Cleanup calls immediately, no only so they are not forgotten (like lp2
was in this case), but because they must run after this point no matter how or when the test exits - which could be before the old Cleanup call at the end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @asoliman92
@@ -812,7 +814,7 @@ func testSetup( | |||
headTracker, | |||
lpOpts, | |||
) | |||
assert.NoError(t, lp.Start(ctx)) | |||
servicetest.Run(t, lp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For service.Service
s, this helper can be used to invoke Start
and register Close
automatically.
AER Report: CI Core ran successfully ✅ |
A log poller instance was left running after test completion.