Skip to content

Commit d43bb3e

Browse files
authored
Merge pull request #58 from saidie/fix/increase_wait_for_test
Increase the time for waiting dummy fluentd processes to fix the tests
2 parents 22ba8e0 + 4267cc7 commit d43bb3e

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

spec/fluent_logger_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@
119119
expect {
120120
logger.post('tag', data)
121121
}.to raise_error(ArgumentError)
122+
123+
fluentd.wait_transfer # ensure the fluentd accepted the connection
122124
}
123125
end
124126

@@ -128,6 +130,7 @@
128130
host, port = fluent_logger.instance_eval { [@host, @port] }
129131
expect(host).to eq 'localhost'
130132
expect(port).to eq fluentd.port
133+
fluentd.wait_transfer # ensure the fluentd accepted the connection
131134
end
132135

133136
it "hash argument" do
@@ -139,6 +142,7 @@
139142
host, port = fluent_logger.instance_eval { [@host, @port] }
140143
expect(host).to eq 'localhost'
141144
expect(port).to eq fluentd.port
145+
fluentd.wait_transfer # ensure the fluentd accepted the connection
142146
end
143147
end
144148
end

spec/level_fluent_logger_spec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,22 @@
5757
})
5858
expect(level_fluent_logger.level).to eq 0
5959
expect(level_fluent_logger.progname).to be_nil
60+
fluentd.wait_transfer # ensure the fluentd accepted the connection
6061
}
6162

6263
it ('close') {
6364
expect(level_logger).to be_connect
6465
level_logger.close
6566
expect(level_logger).not_to be_connect
67+
fluentd.wait_transfer # ensure the fluentd accepted the connection
6668
}
6769

6870
it ('reopen') {
6971
expect(level_logger).to be_connect
7072
level_logger.reopen
7173
expect(level_logger).not_to be_connect
7274
expect(level_logger.info('logger reopen test')).to be true
75+
fluentd.wait_transfer # ensure the fluentd accepted the connection
7376
}
7477
end
7578

spec/support/dummy_fluentd.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def initialize
99
output.emits.clear rescue nil
1010
end
1111

12-
WAIT = ENV['WAIT'] ? ENV['WAIT'].to_f : 0.1
12+
WAIT = ENV['WAIT'] ? ENV['WAIT'].to_f : 0.3
1313

1414
def wait_transfer
1515
sleep WAIT

0 commit comments

Comments
 (0)