CI: Use Driver::logs
for asserting log messages
#4136
Labels
enhancement
Feature request or improve operations
Driver::logs
for asserting log messages
#4136
Describe the bug
Some tests are asserting log messages as follows.
We should fix these tests.
shutdown: false
and manually dod.instance_shutdown
Driver::instance
fluentd/test/plugin/test_in_forward.rb
Lines 186 to 203 in 206b46b
We should not use this approach.
The log messages of the instance will be cleared after the shutdown, but we can still take log messages from
Driver::logs
.So we should use
Driver::logs
and should not useshutdown: false
for this purpose.Note:
Driver::logs
is the same instance asinstance.log.out.logs
(=instance.log.logs
), butreset
will not clear it, just re-assign the new list toDummyLogDevice
. So we can useDriver::logs
after the shutdown.fluentd/lib/fluent/test/driver/base_owner.rb
Lines 30 to 31 in 206b46b
fluentd/lib/fluent/test/log.rb
Lines 32 to 34 in 206b46b
To Reproduce
None.
Expected behavior
None.
Your Environment
Your Configuration
Your Error Log
Additional context
The document also says we should use
Driver::logs
.https://docs.fluentd.org/plugin-development/plugin-test-code#tests-for-logs
The text was updated successfully, but these errors were encountered: