Skip to content

Commit e3c9792

Browse files
Watson1978daipom
authored andcommitted
ci: remove reference to mock object after test (fluent#5055)
**Which issue(s) this PR fixes**: Fixes fluent#5054 **What this PR does / why we need it**: This PR will resolve CI error. **Docs Changes**: N/A **Release Note**: N/A --------- Signed-off-by: Shizuo Fujita <[email protected]> Signed-off-by: Daijiro Fukuda <[email protected]>
1 parent daccbc6 commit e3c9792

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

test/plugin/test_in_object_space.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ def test_configure
5050
end
5151

5252
def test_emit
53+
# Force release garbaged objects due to avoid unexpected error by mock objects on `on_timer`
54+
# https://github.com/fluent/fluentd/pull/5055
55+
GC.start
56+
5357
d = create_driver
5458

5559
d.run(expect_emits: 3)

test/plugin/test_input.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,5 +133,7 @@ def emit(tag, es)
133133
assert{ @p.router.object_id != original_router.object_id }
134134

135135
@p.router.emit('mytag.testing', ['for mock'])
136+
ensure
137+
Fluent::Engine.root_agent.labels['@mytest'] = nil
136138
end
137139
end

test/plugin_helper/test_event_emitter.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ class Dummy < Fluent::Plugin::TestBase
7070
d.configure(config_element('ROOT', '', {'@label' => '@mytest'}))
7171
router = d.event_emitter_router("@mytest")
7272
assert_equal router_mock, router
73+
ensure
74+
Fluent::Engine.root_agent.labels['@mytest'] = nil
7375
end
7476

7577
test 'get root router' do

0 commit comments

Comments
 (0)