Skip to content

Make handler tests faster by caching self-signed certificates#14344

Merged
chrisvest merged 1 commit intonetty:4.1from
chrisvest:4.1-faster-ssl-tests
Sep 19, 2024
Merged

Make handler tests faster by caching self-signed certificates#14344
chrisvest merged 1 commit intonetty:4.1from
chrisvest:4.1-faster-ssl-tests

Conversation

@chrisvest
Copy link
Copy Markdown
Member

Motivation:
In Netty 4.1, we test our SSL code with RSA keys.
These keys are expensive to generate, so it's desirable to cache and reuse them across multiple tests when possible.

Modification:
Add a CachedSelfSignedCertificate holder class to the test code. Use the cached certificate in every test that 1) does not already cache its certificates, and 2) only uses one certificate, and 3) were using the default SelfSignedCertificate constructor.

Result:
These tests, many of which are parameterized in various ways, now run much faster, shaving minutes off our builds.

Motivation:
In Netty 4.1, we test our SSL code with RSA keys.
These keys are expensive to generate, so it's desirable to cache and reuse them across multiple tests when possible.

Modification:
Add a CachedSelfSignedCertificate holder class to the test code.
Use the cached certificate in every test that 1) does not already cache its certificates, and 2) only uses one certificate, and 3) were using the default SelfSignedCertificate constructor.

Result:
These tests, many of which are parameterized in various ways, now run much faster, shaving minutes off our builds.
Copy link
Copy Markdown
Member

@normanmaurer normanmaurer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one!

@chrisvest chrisvest merged commit f3562d2 into netty:4.1 Sep 19, 2024
@chrisvest chrisvest deleted the 4.1-faster-ssl-tests branch September 19, 2024 17:06
chrisvest added a commit that referenced this pull request Sep 19, 2024
Motivation:
In Netty 4.2, we test our SSL code with RSA keys.
These keys are expensive to generate, so it's desirable to cache and
reuse them across multiple tests when possible.

Modification:
Add a CachedSelfSignedCertificate holder class to the test code. Use the
cached certificate in every test that 1) does not already cache its
certificates, and 2) only uses one certificate, and 3) were using the
default SelfSignedCertificate constructor.

Result:
These tests, many of which are parameterized in various ways, now run
much faster, shaving minutes off our builds.
@chrisvest chrisvest added this to the 4.1.114.Final milestone Sep 19, 2024
chrisvest added a commit that referenced this pull request Sep 28, 2024
Motivation:
In Netty 5, we currently test our SSL code with RSA keys.
These keys are expensive to generate, so it's desirable to cache and
reuse them across multiple tests when possible.

Modification:
Add a CachedSelfSignedCertificate holder class to the test code. Use the
cached certificate in every test that 1) does not already cache its
certificates, and 2) only uses one certificate, and 3) were using the
default SelfSignedCertificate constructor.

Result:
These tests, many of which are parameterized in various ways, now run
much faster, shaving minutes off our builds.

This is a forward port of #14344
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.

2 participants