diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2decf5..6b3872c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,7 +49,7 @@ jobs: node-version: "16.x" - name: Install tools shell: bash - run: "gem install --no-document bundler toys && bundle install" + run: "gem install --no-document toys && bundle install" - name: Test ${{ matrix.task }} shell: bash run: toys do ${{ matrix.task }} < /dev/null diff --git a/lib/google/cloud/env/compute_metadata.rb b/lib/google/cloud/env/compute_metadata.rb index 39a8282..aba7c59 100644 --- a/lib/google/cloud/env/compute_metadata.rb +++ b/lib/google/cloud/env/compute_metadata.rb @@ -389,12 +389,12 @@ def lookup_response path, retry_count: :default, retry_timeout: :default query = canonicalize_query query - raise MetadataServerNotResponding unless gce_check if @overrides @mutex.synchronize do return lookup_override path, query if @overrides end end + raise MetadataServerNotResponding unless gce_check retry_count = self.retry_count if retry_count == :default retry_count += 1 if retry_count retry_timeout = self.retry_timeout if retry_timeout == :default @@ -845,6 +845,7 @@ def lookup_override path, query @existence = :no raise MetadataServerNotResponding end + @existence = :confirmed result = @overrides.lookup path, query: query result ||= Response.new 404, "Not found", FLAVOR_HEADER result diff --git a/test/helper.rb b/test/helper.rb index 01e3a7d..6333494 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -16,4 +16,5 @@ require "minitest/autorun" require "minitest/focus" require "minitest/rg" +require "base64" require "json"