Skip to content

Commit

Permalink
Merge pull request #2898 from ganmacs/fix-unstable-test-in-dummy
Browse files Browse the repository at this point in the history
Extend timeout and remove unnecessary emit(decreasing rate)
  • Loading branch information
ganmacs authored Mar 23, 2020
2 parents 5f56080 + e7983d4 commit 86c7b71
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/plugin/test_in_dummy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def create_driver(conf)
sub_test_case 'when dummy plugin has storage which is not specified the path' do
config1 = {
'tag' => 'dummy',
'rate' => '2',
'rate' => '0',
'dummy' => '[{"x": 1, "y": "1"}, {"x": 2, "y": "2"}, {"x": 3, "y": "3"}]',
'auto_increment_key' => 'id',
}
Expand All @@ -108,7 +108,7 @@ def create_driver(conf)

d1 = create_driver(conf1)
d1.run(timeout: 0.5) do
d1.instance.emit(4)
d1.instance.emit(2)
end

events = d1.events.sort{|a,b| a[2]['id'] <=> b[2]['id'] }
Expand All @@ -123,7 +123,7 @@ def create_driver(conf)

d2 = create_driver(conf1)
d2.run(timeout: 0.5) do
d2.instance.emit(4)
d2.instance.emit(2)
end

events = d2.events.sort{|a,b| a[2]['id'] <=> b[2]['id'] }
Expand All @@ -145,7 +145,7 @@ def create_driver(conf)
config2 = {
'@id' => 'test-02',
'tag' => 'dummy',
'rate' => '2',
'rate' => '0',
'dummy' => '[{"x": 1, "y": "1"}, {"x": 2, "y": "2"}, {"x": 3, "y": "3"}]',
'auto_increment_key' => 'id',
}
Expand All @@ -163,8 +163,8 @@ def create_driver(conf)
assert !File.exist?(File.join(TEST_PLUGIN_STORAGE_PATH, 'json', 'test-02.json'))

d1 = create_driver(conf2)
d1.run(timeout: 0.5) do
d1.instance.emit(4)
d1.run(timeout: 1) do
d1.instance.emit(2)
end

first_id1 = d1.events.first[2]['id']
Expand All @@ -176,8 +176,8 @@ def create_driver(conf)
assert File.exist?(File.join(TEST_PLUGIN_STORAGE_PATH, 'json', 'test-02.json'))

d2 = create_driver(conf2)
d2.run(timeout: 0.5) do
d2.instance.emit(4)
d2.run(timeout: 1) do
d2.instance.emit(2)
end
d2.events

Expand Down

0 comments on commit 86c7b71

Please sign in to comment.