From f7a0fe1dfca85cf03b90400e089b19fbe6199f4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Rodr=C3=ADguez?= Date: Tue, 27 Jun 2017 18:05:43 -0400 Subject: Output to debug gitaly_client test --- lib/gitlab/gitaly_client.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/gitlab/gitaly_client.rb b/lib/gitlab/gitaly_client.rb index f605c06dfc3..dc43ef2cbd8 100644 --- a/lib/gitlab/gitaly_client.rb +++ b/lib/gitlab/gitaly_client.rb @@ -57,7 +57,7 @@ module Gitlab metadata = yield(metadata) if block_given? stub(service, storage).send(rpc, request, metadata) end - + def self.request_metadata(storage) encoded_token = Base64.strict_encode64(token(storage).to_s) { metadata: { 'authorization' => "Bearer #{encoded_token}" } } @@ -75,18 +75,24 @@ module Gitlab end def self.feature_enabled?(feature, status: MigrationStatus::OPT_IN) + puts + puts "feature_enabled?(#{feature},#{status})" + puts "enabled? = '#{enabled?}'" return false if !enabled? || status == MigrationStatus::DISABLED feature = Feature.get("gitaly_#{feature}") # If the feature hasn't been set, turn it on if it's opt-out + puts "Feature.persisted?(#{feature}) = '#{Feature.persisted?(feature)}'" return status == MigrationStatus::OPT_OUT unless Feature.persisted?(feature) if feature.percentage_of_time_value > 0 # Probabilistically enable this feature + puts "Returning random based on '#{feature.percentage_of_time_value}'" return Random.rand() * 100 < feature.percentage_of_time_value end + puts "feature.enabled? = '#{feature.enabled?}'" feature.enabled? end -- cgit v1.2.1