-
Notifications
You must be signed in to change notification settings - Fork 706
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
Adding a harness for session resumption in regression test #4706
Conversation
Co-authored-by: maddeleine <59030281+maddeleine@users.noreply.github.com>
tests/regression/src/lib.rs
Outdated
#[test] | ||
fn test_session_resumption() { | ||
valgrind_test("test_session_resumption", 0.01, |ctrl| { | ||
const KEY_NAME: &str = "InsecureTestKey"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I'd vote for moving the constants into the top level scope of the function.
tests/regression/src/lib.rs
Outdated
.add_session_ticket_key( | ||
KEY_NAME.as_bytes(), | ||
KEY_VALUE.as_slice(), | ||
SystemTime::now(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clock skew will cause this to sometimes be flaky, because the system clock will sometimes jump in time.
SystemTime::now(), | |
SystemTime::now() - Duration::from_secs(10), |
The regression test will fail since mainline doesn't have the session resumption test yet. Typically changes to solely the regression test will not trigger the test to run but since I changed the .gitignore file (exists outside the regression crate) in a recent commit, the test still runs on this PR. |
Co-authored-by: James Mayclin <maycj@amazon.com>
Description of changes:
This PR adds a new regression test for measuring session resumption performance in the s2n-tls library. The test, test_session_resumption, performs an initial handshake without a session ticket and then attempts to resume the session using a session ticket in a subsequent handshake. The test is integrated with the valgrind_test function, allowing Cachegrind instrumentation to measure the performance of the session resumption process.
Call-outs:
pair.client.session_ticket()
call is left out of the instrumentation measurement since that occurs in the first handshake.