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

Failing unit test #60

Open
harisang opened this issue Jan 5, 2024 · 8 comments
Open

Failing unit test #60

harisang opened this issue Jan 5, 2024 · 8 comments

Comments

@harisang
Copy link
Contributor

harisang commented Jan 5, 2024

@fhenneke first pointed out that there is some test that is now failing. Since I am personally a bit ignorant about this, any help would be appreciated. One option would be to just remove this test. cc @bh2smith @MartinquaXD

`=================================== FAILURES ===================================
__________________________ TestIPFS.test_get_content ___________________________

self = <tests.unit.test_ipfs.TestIPFS testMethod=test_get_content>

def test_get_content(self):
    self.assertEqual(
        {
            "version": "0.1.0",
            "appCode": "CowSwap",
            "metadata": {
                "referrer": {
                    "version": "0.1.0",
                    "address": "0x424a46612794dbb8000194937834250Dc723fFa5",
                }
            },
        },
        Cid.old_schema(
            "3d876de8fcd70969349c92d731eeb0482fe8667ceca075592b8785081d630b9a"
        ).get_content(ACCESS_KEY, max_retries=10),
    )
       self.assertEqual(
        {
            "version": "1.0.0",
            "appCode": "CowSwap",
            "metadata": {
                "referrer": {
                    "kind": "referrer",
                    "referrer": "0x8c35B7eE520277D14af5F6098835A584C337311b",
                    "version": "1.0.0",
                }
            },
        },
        Cid.old_schema(
            "1FE7C5555B3F9C14FF7C60D90F15F1A5B11A0DA5B1E8AA043582A1B2E1058D0C"
        ).get_content(ACCESS_KEY),
    )
 AssertionError: {'version': '1.0.0', 'appCode': 'CowSwap'[122 chars]0'}}} != None

tests/unit/test_ipfs.py:73: AssertionError
=========================== short test summary info ============================
FAILED tests/unit/test_ipfs.py::TestIPFS::test_get_content - AssertionError: {'version': '1.0.0', 'appCode': 'CowSwap'[122 chars]0'}}} != None`
@bh2smith
Copy link
Contributor

bh2smith commented Jan 5, 2024

At first looks like an "intermittent failure" possibly because of a failure to retrieve app_data at the given hash. Have you tried running the test locally? Because one would not expect to get None.

@harisang
Copy link
Contributor Author

harisang commented Jan 5, 2024

Will try to do that.

Btw, there is some "inconsistency" in the code, but i have no idea if this affects things. In that test, in some cases we use

.get_content(ACCESS_KEY, max_retries=10)

and in some other cases we have .get_content(ACCESS_KEY)

Not sure if this max_retries would change anything though

@bh2smith
Copy link
Contributor

bh2smith commented Jan 5, 2024

max_retries is an optional field which defaults to ... something. Should be able to see this in the function signature.

@harisang
Copy link
Contributor Author

harisang commented Jan 5, 2024

max_retries is an optional field which defaults to ... something. Should be able to see this in the function signature.

Right, indeed this defaults to 3, so probably it shouldn't affect things.

I ran the tests locally and i am observing the same error as the one reported above.

@bh2smith
Copy link
Contributor

bh2smith commented Jan 5, 2024

Is it possible that someone has purged the old data? I always thought IPFS was immutable/permanent storage.

@MartinquaXD
Copy link
Contributor

AFAIK the only guaranteed way for data to stay available on IPFS is if you run your own node and pin the data you are interested in yourself. Otherwise people purge the data.

One option would be to just remove this test.

We could do that but I guess it would be nicer to find some other data that is still available on IPFS and replace the test. (Although that only delays the problem until we run our own IPFS node just for this purpose 😅)

@harisang
Copy link
Contributor Author

harisang commented Jan 11, 2024

but I guess it would be nicer to find some other data that is still available on IPFS and replace the test.

True, but that requires first understanding what the test is actually testing.... Might give it a shot at some point.

@MartinquaXD
Copy link
Contributor

These tests basically just assert that the python library is able to find a document stored on IPFS given the IPFS hash and that the found document matches your expected object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants