Sha256: 4d15dcd190f8f8edc8960ce0ce22ab769f675df8b601ce466642e978bc42814b

Contents?: true

Size: 819 Bytes

Versions: 169

Compression:

Stored size: 819 Bytes

Contents

require_relative '../../helper'
require 'fluent/plugin_helper/service_discovery/round_robin_balancer'

class TestRoundRobinBalancer < ::Test::Unit::TestCase
  test 'select_service' do
    rrb = Fluent::PluginHelper::ServiceDiscovery::RoundRobinBalancer.new
    rrb.rebalance([1, 2, 3])

    rrb.select_service { |n| assert_equal 1, n }
    rrb.select_service { |n| assert_equal 2, n }
    rrb.select_service { |n| assert_equal 3, n }
    rrb.select_service { |n| assert_equal 1, n }
    rrb.select_service { |n| assert_equal 2, n }
    rrb.select_service { |n| assert_equal 3, n }
    rrb.rebalance([1, 2, 3, 4])
    rrb.select_service { |n| assert_equal 1, n }
    rrb.select_service { |n| assert_equal 2, n }
    rrb.select_service { |n| assert_equal 3, n }
    rrb.select_service { |n| assert_equal 4, n }
  end
end

Version data entries

169 entries across 169 versions & 7 rubygems

Version Path
fluentd-1.16.7-x64-mingw32 test/plugin_helper/service_discovery/test_round_robin_balancer.rb
fluentd-1.16.7-x86-mingw32 test/plugin_helper/service_discovery/test_round_robin_balancer.rb
fluentd-1.16.7-x64-mingw-ucrt test/plugin_helper/service_discovery/test_round_robin_balancer.rb
fluentd-1.16.7 test/plugin_helper/service_discovery/test_round_robin_balancer.rb
fluent-plugin-nuopenlineage-light-0.1.0 vendor/bundle/ruby/3.3.0/gems/fluentd-1.17.0-x64-mingw-ucrt/test/plugin_helper/service_discovery/test_round_robin_balancer.rb
fluentd-1.16.6-x86-mingw32 test/plugin_helper/service_discovery/test_round_robin_balancer.rb
fluentd-1.16.6-x64-mingw32 test/plugin_helper/service_discovery/test_round_robin_balancer.rb
fluentd-1.16.6-x64-mingw-ucrt test/plugin_helper/service_discovery/test_round_robin_balancer.rb
fluentd-1.16.6 test/plugin_helper/service_discovery/test_round_robin_balancer.rb
fluent-plugin-openlineage-light-0.1.4 vendor/bundle/ruby/3.3.0/gems/fluentd-1.17.0-x64-mingw-ucrt/test/plugin_helper/service_discovery/test_round_robin_balancer.rb
fluent-plugin-openlineage-light-0.1.3 vendor/bundle/ruby/3.3.0/gems/fluentd-1.17.0-x64-mingw-ucrt/test/plugin_helper/service_discovery/test_round_robin_balancer.rb
fluent-plugin-openlineage-0.1.0 vendor/bundle/ruby/3.3.0/gems/fluentd-1.17.0-x64-mingw-ucrt/test/plugin_helper/service_discovery/test_round_robin_balancer.rb
fluentd-1.17.0-x86-mingw32 test/plugin_helper/service_discovery/test_round_robin_balancer.rb
fluentd-1.17.0-x64-mingw-ucrt test/plugin_helper/service_discovery/test_round_robin_balancer.rb
fluentd-1.17.0-x64-mingw32 test/plugin_helper/service_discovery/test_round_robin_balancer.rb
fluentd-1.17.0 test/plugin_helper/service_discovery/test_round_robin_balancer.rb
fluentd-1.16.5-x64-mingw-ucrt test/plugin_helper/service_discovery/test_round_robin_balancer.rb
fluentd-1.16.5-x86-mingw32 test/plugin_helper/service_discovery/test_round_robin_balancer.rb
fluentd-1.16.5-x64-mingw32 test/plugin_helper/service_discovery/test_round_robin_balancer.rb
fluentd-1.16.5 test/plugin_helper/service_discovery/test_round_robin_balancer.rb