Skip to content

[Collections] Adjust cert verify date in tests #3402

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

Merged
merged 2 commits into from
Apr 13, 2021

Conversation

yim-lee
Copy link
Contributor

@yim-lee yim-lee commented Apr 13, 2021

Motivation:
Tests in PackageCollectionsSigningTests that involve Test_ec.cer are failing. See #3393.

I think this is a timezone-related issue. Test_ec.cer is valid from November 15, 2020 10:45:20am PST for a year. In the tests we manipulate the timestamp at which the cert validation is done so we don't have to regenerate new test certs and so we can test for different scenarios. That timestamp is set to November 16, 2020 midnight, and depending on where the tests are run, it might potentially mean a time before Test_ec.cer is valid and that's why we see "certificate is not yet valid" error. Note that this doesn't happen with tests that use Test_rsa.cer since the certificate is valid from November 8, 2020.

Modification:
Change verify date to November 18, 2020, which should give us more than enough buffer for various timezones.

Motivation:
Tests in `PackageCollectionsSigningTests` that involve `Test_ec.cer` are failing. See swiftlang#3393.

I think this is a timezone-related issue. `Test_ec.cer` is valid from November 15, 2020 10:45:20am PST for a year. In the tests we manipulate the timestamp at which the cert validation is done so we don't have to regenerate new test certs and so we can test for different scenarios. That timestamp is set to November 16, 2020 midnight, and depending on where the tests are run, it might potentially mean a time before `Test_ec.cer` is valid and that's why we see "certificate is not yet valid" error. Note that this doesn't happen with tests that use `Test_rsa.cer` since the certificate is valid from November 8, 2020.

Modification:
Change verify date to November 18, 2020, which should give us more than enough buffer for various timezones.
@yim-lee
Copy link
Contributor Author

yim-lee commented Apr 13, 2021

@swift-ci please smoke test

@yim-lee
Copy link
Contributor Author

yim-lee commented Apr 13, 2021

@swift-ci please smoke test

@finagolfin
Copy link
Member

I applied this patch and it fixed those three tests on Android, the different time zone was definitely the issue.

@yim-lee yim-lee merged commit 157cdb0 into swiftlang:main Apr 13, 2021
@yim-lee yim-lee deleted the test-cert-validity branch April 13, 2021 21:04
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

Successfully merging this pull request may close these issues.

3 participants