Skip to content

Commit

Permalink
Try to fix CI issue with TrafficServer not starting again after test.
Browse files Browse the repository at this point in the history
  • Loading branch information
GUI committed Feb 12, 2024
1 parent 3b3cab3 commit 29ea022
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/processes/test_fluent_bit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ def test_opensearch_error_log_to_console
# Test the temporary workaround for trafficserver's error.log not being able
# to direct to stderr. Can probably remove once we're on TrafficServer 10+.
def test_trafficserver_error_log_to_console
error_log_path = File.join($config["log_dir"], "trafficserver/error.log")
FileUtils.rm_f(error_log_path)

override_config({
"log" => {
"destination" => "console",
Expand All @@ -109,10 +112,12 @@ def test_trafficserver_error_log_to_console
# Not obvious how to actually trigger content to the error.log, so
# manually append some content to simulate this.
error_content = SecureRandom.uuid
File.write(File.join($config["log_dir"], "trafficserver/error.log"), "#{error_content}\n", mode: "a+")
File.write(error_log_path, "#{error_content}\n", mode: "a+")

log = log_tail.read_until(/#{error_content}/, timeout: 30)
assert_match(/trafficserver:.*{"log"=>"#{error_content}"}/, log)
ensure
FileUtils.rm_f(error_log_path)
end
end

Expand Down

0 comments on commit 29ea022

Please sign in to comment.