fsspec / fsspec/filesystem_spec

gcsfs test_GoogleCredentials_None failing on the main branch?

Open
#636 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.4k
Forks
490
Avg merge
2d 3h
Merged PRs (30d)
38

Description

The gcsfs test test_GoogleCredentials_None appears to be failing on the main branch.

I tried testing it locally like this:

conda env create -f ci/environment-py38.yml
conda activate test_env
tox -e gcsfs
=================================== FAILURES ===================================
_________________________ test_GoogleCredentials_None __________________________

    @my_vcr.use_cassette(match=["all"])
    def test_GoogleCredentials_None():
>       credentials = GoogleCredentials(project=None, token=None, access="read_only")

gcsfs/gcsfs/tests/test_credentials.py:7: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
gcsfs/gcsfs/credentials.py:52: in __init__
    self.connect(method=token)
gcsfs/gcsfs/credentials.py:214: in connect
    self.connect(method=meth)
gcsfs/gcsfs/credentials.py:226: in connect
    self.__getattribute__("_connect_" + method)()
gcsfs/gcsfs/credentials.py:73: in _connect_google_default
    credentials, project = gauth.default(scopes=[self.scope])
../lib/python3.8/site-packages/google/auth/_default.py:454: in default
    credentials, project_id = checker()
../lib/python3.8/site-packages/google/auth/_default.py:450: in <lambda>
    lambda: _get_gce_credentials(request),
../lib/python3.8/site-packages/google/auth/_default.py:272: in _get_gce_credentials
    if _metadata.ping(request=request):
../lib/python3.8/site-packages/google/auth/compute_engine/_metadata.py:85: in ping
    response = request(
../lib/python3.8/site-packages/google/auth/transport/_http_client.py:107: in __call__
    response = connection.getresponse()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <vcr.patch.VCRHTTPConnection/home/genevieve/GitHub/filesystem_spec/.tox/gcsfs/tmp/gcsfs/gcsfs/tests/recordings/test_GoogleCredentials_None.yaml object at 0x7f088df95460>
_ = False, kwargs = {}

    def getresponse(self, _=False, **kwargs):
        """Retrieve the response"""
        # Check to see if the cassette has a response for this request. If so,
        # then return it
        if self.cassette.can_play_response_for(self._vcr_request):
            log.info("Playing response for {} from cassette".format(self._vcr_request))
            response = self.cassette.play_response(self._vcr_request)
            return VCRHTTPResponse(response)
        else:
            if self.cassette.write_protected and self.cassette.filter_request(self._vcr_request):
>               raise CannotOverwriteExistingCassetteException(
                    cassette=self.cassette, failed_request=self._vcr_request
                )
E               vcr.errors.CannotOverwriteExistingCassetteException: Can't overwrite existing cassette ('/home/genevieve/GitHub/filesystem_spec/.tox/gcsfs/tmp/gcsfs/gcsfs/tests/recordings/test_GoogleCredentials_None.yaml') in your current record mode ('none').
E               No match for the request (<Request (GET) http://169.254.169.254>) was found.
E               No similar requests, that have not been played, found.

../lib/python3.8/site-packages/vcr/stubs/__init__.py:231: CannotOverwriteExistingCassetteException
=========================== short test summary info ============================
FAILED gcsfs/gcsfs/tests/test_credentials.py::test_GoogleCredentials_None - v...
= 1 failed, 92 passed, 10 skipped, 1 deselected, 1 xfailed, 1 xpassed in 37.55s =
ERROR: InvocationError for command /home/genevieve/GitHub/filesystem_spec/.tox/gcsfs/bin/py.test -vv gcsfs/gcsfs -k 'not fuse' (exited with code 1)
___________________________________ summary ____________________________________
ERROR:   gcsfs: commands failed

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with gcsfs/gcsfs/tests/test_credentials.py and gcsfs/gcsfs/credentials.py, then run tox -e gcsfs using the reported environment. Inspect the test_GoogleCredentials_None cassette and the credential connection path for the unmatched metadata request. Done means the test passes and the gcsfs test suite no longer reports this failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
google-cloud, python
Domain
cloud, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.