Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Fix stalled tests on Ruby 3.1 #3577

Merged
merged 1 commit into from
Dec 21, 2021
Merged

Commits on Dec 21, 2021

  1. test: Fix stalled tests on Ruby 3.1

    Several tests are stalled since Ruby 3.1, I found that it's caused by
    the followig Ruby's change:
    
      ruby/ruby@2d98593
    
    It seems that there are some conditions to reproduce it:
    
      * `attr_reader` is defined in a class
      * `$log` is accessed by it
      * `assert` is called with a block
      * `assert` refers the `$log` via the `attr_reader`
      * ... (some other conditions seem needed but not clarified yet)
    
    Here is the sample test case to reproduce it:
    
    ```ruby
    require 'fluent/test'
    
    class StallTest < Test::Unit::TestCase
      class Stall
        attr_reader :log
        def initialize
          @log = $log
        end
      end
    
      setup do
        Fluent::Test.setup
      end
    
      20.times do |i|
        test "stall #{i}" do
          assert { Stall.new.log }
        end
      end
    end
    ```
    
    Becasue all stalled tests don't need to use block, I remove these blocks
    to avoid this issue.
    
    Fix #3543
    
    Signed-off-by: Takuro Ashie <ashie@clear-code.com>
    ashie committed Dec 21, 2021
    Configuration menu
    Copy the full SHA
    2c3e6c1 View commit details
    Browse the repository at this point in the history