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

'test_get_signed_policy_v4' flakes with 500 #228

Closed
tseaver opened this issue Aug 5, 2020 · 0 comments · Fixed by #251
Closed

'test_get_signed_policy_v4' flakes with 500 #228

tseaver opened this issue Aug 5, 2020 · 0 comments · Fixed by #251
Assignees
Labels
api: storage Issues related to the googleapis/python-storage API. flaky flaky systests / samples testing type: process A process-related concern. May include testing, release, or the like.

Comments

@tseaver
Copy link
Contributor

tseaver commented Aug 5, 2020

From this Kokoro build:

_________________ TestV4POSTPolicies.test_get_signed_policy_v4 _________________

self = <test_system.TestV4POSTPolicies testMethod=test_get_signed_policy_v4>

    def test_get_signed_policy_v4(self):
        bucket_name = "post_policy" + unique_resource_id("-")
        self.assertRaises(exceptions.NotFound, Config.CLIENT.get_bucket, bucket_name)
        retry_429_503(Config.CLIENT.create_bucket)(bucket_name)
        self.case_buckets_to_delete.append(bucket_name)

        blob_name = "post_policy_obj.txt"
        with open(blob_name, "w") as f:
            f.write("DEADBEEF")

        policy = Config.CLIENT.generate_signed_post_policy_v4(
            bucket_name,
            blob_name,
            conditions=[
                {"bucket": bucket_name},
                ["starts-with", "$Content-Type", "text/pla"],
            ],
            expiration=datetime.datetime.now() + datetime.timedelta(hours=1),
            fields={"content-type": "text/plain"},
        )
        with open(blob_name, "r") as f:
            files = {"file": (blob_name, f)}
            response = requests.post(policy["url"], data=policy["fields"], files=files)

        os.remove(blob_name)
>       self.assertEqual(response.status_code, 204)
E       AssertionError: 500 != 204

tests/system/test_system.py:2347: AssertionError
@tseaver tseaver added type: process A process-related concern. May include testing, release, or the like. testing flaky flaky systests / samples labels Aug 5, 2020
@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/python-storage API. label Aug 5, 2020
@HemangChothani HemangChothani self-assigned this Aug 19, 2020
gcf-merge-on-green bot pushed a commit that referenced this issue Aug 25, 2020
Fixes #228  🦕

I think it's related to #244 issue so changed datetime.now() to datetime.utcnow()
cojenco pushed a commit to cojenco/python-storage that referenced this issue Oct 13, 2021
Fixes googleapis#228  🦕

I think it's related to googleapis#244 issue so changed datetime.now() to datetime.utcnow()
cojenco pushed a commit to cojenco/python-storage that referenced this issue Oct 13, 2021
Fixes googleapis#228  🦕

I think it's related to googleapis#244 issue so changed datetime.now() to datetime.utcnow()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/python-storage API. flaky flaky systests / samples testing type: process A process-related concern. May include testing, release, or the like.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants