From 8773e7110b98114e3fd66f9233dff8ebc16cf836 Mon Sep 17 00:00:00 2001 From: Christian Bruckmayer Date: Tue, 27 Aug 2024 14:43:29 +0100 Subject: [PATCH] Fix warnings --- ruby/lib/minitest/queue/runner.rb | 5 +++-- ruby/test/ci/queue/redis_test.rb | 3 +-- ruby/test/integration/minitest_redis_test.rb | 9 +-------- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/ruby/lib/minitest/queue/runner.rb b/ruby/lib/minitest/queue/runner.rb index daf53f6a..282b9e14 100644 --- a/ruby/lib/minitest/queue/runner.rb +++ b/ruby/lib/minitest/queue/runner.rb @@ -223,7 +223,7 @@ def bisect_command failing_order = queue.candidates step("Final validation") - status = if run_tests_in_fork(failing_order) + if run_tests_in_fork(failing_order) step(yellow("The bisection was inconclusive, there might not be any leaky test here.")) File.write('log/test_order.log', "") exit! 1 @@ -314,7 +314,8 @@ def report_grind_command private attr_reader :queue_config, :options, :command, :argv - attr_accessor :queue, :queue_url, :grind_list, :grind_count, :load_paths, :verbose + attr_writer :queue_url + attr_accessor :queue, :grind_list, :grind_count, :load_paths, :verbose def require_worker_id! if queue.distributed? diff --git a/ruby/test/ci/queue/redis_test.rb b/ruby/test/ci/queue/redis_test.rb index 36e283c5..5c5bd139 100644 --- a/ruby/test/ci/queue/redis_test.rb +++ b/ruby/test/ci/queue/redis_test.rb @@ -281,8 +281,7 @@ def build_queue end def populate(worker, tests: TEST_LIST.dup) - capture_io { worker.populate(tests, random: Random.new(0)) } - worker + worker.populate(tests, random: Random.new(0)) end def worker(id, **args) diff --git a/ruby/test/integration/minitest_redis_test.rb b/ruby/test/integration/minitest_redis_test.rb index 0f49bffd..132b983a 100644 --- a/ruby/test/integration/minitest_redis_test.rb +++ b/ruby/test/integration/minitest_redis_test.rb @@ -216,7 +216,6 @@ def test_max_test_failed assert_equal 'Ran 47 tests, 47 assertions, 3 failures, 0 errors, 0 skips, 44 requeues in X.XXs', output # Run the reporter - exit_code = nil out, err = capture_subprocess_io do system( @exe, 'report', @@ -862,12 +861,6 @@ def test_redis_reporter ) end - warning = <<~END - [WARNING] Atest#test_bar was picked up by another worker because it didn't complete in the allocated 2 seconds. - You may want to either optimize this test or bump ci-queue timeout. - It's also possible that the worker that was processing it was terminated without being able to report back. - END - warnings_file.rewind content = JSON.parse(warnings_file.read) assert_equal 1, content.size @@ -953,7 +946,7 @@ def test_application_error assert_equal 42, $?.exitstatus - out, err = capture_subprocess_io do + out, _ = capture_subprocess_io do system( @exe, 'report', '--queue', @redis_url,