Skip to content

Commit 2e90d3e

Browse files
Ensure we're puts'ing to STDOUT
1 parent ae138d6 commit 2e90d3e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

ruby/lib/ci/queue/redis/worker.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# frozen_string_literal: true
22
require 'ci/queue/static'
33
require 'set'
4+
require 'ci/queue/output_helpers'
45

56
module CI
67
module Queue
@@ -51,13 +52,15 @@ def master?
5152
def poll
5253
wait_for_master
5354
last_heartbeat_time = Time.now
55+
STDOUT.sync = true
5456
until shutdown_required? || config.circuit_breakers.any?(&:open?) || exhausted? || max_test_failed?
5557
if test = reserve
5658
yield index.fetch(test)
5759
else
5860
# Log heartbeat every 5 minutes if this is the master process
5961
if master? && Time.now - last_heartbeat_time > 300
60-
puts '[ci-queue] Still working'
62+
STDOUT.puts '[ci-queue] Still working'
63+
STDOUT.flush
6164
last_heartbeat_time = Time.now
6265
end
6366
sleep 0.05

0 commit comments

Comments
 (0)