From e44780d3d91b2936208de0b6f124e68dabe6867e Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Thu, 16 Mar 2023 14:09:59 +0900 Subject: [PATCH] spec: Make sure to wait server for TLS tests Signed-off-by: Takuro Ashie --- spec/fluent_logger_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/fluent_logger_spec.rb b/spec/fluent_logger_spec.rb index e41984c..23a47d2 100644 --- a/spec/fluent_logger_spec.rb +++ b/spec/fluent_logger_spec.rb @@ -382,6 +382,16 @@ def flush(messages) before(:each) do fluentd.startup(true) + # Make sure to wait TLS server since preparing it takes longer time than + # non-TLS so that it might be too early especially on CI environment + 3.times do + begin + TCPSocket.open('localhost', fluentd.port) {} + break + rescue + fluentd.wait_transfer + end + end end after(:each) do