Skip to content

test: deflake test-tls-resume-servername - #67458

Closed
mcollina wants to merge 1 commit into
nodejs:mainfrom
mcollina:test-deflake-tls-resume-servername
Closed

mcollina wants to merge 1 commit into
nodejs:mainfrom
mcollina:test-deflake-tls-resume-servername

Conversation

@mcollina

Copy link
Copy Markdown
Member

The PSK server in this test returned the secret for any identity. The client also offers its resumption ticket as a PSK identity, and OpenSSL passes it to pskCallback when its leading bytes read as a string, for example '' when the random ticket key name starts with a NUL byte. The server then took the ticket as an external PSK with the wrong key, and the handshake failed the binder check with decrypt_error.

This happened in about 0.7% of runs locally (7/1000) and showed up in CI on #67271 (job). With the fix, the server only answers for the 'client' identity, and 1000 runs passed. Forcing a ticket key name that starts with a NUL byte fails every time before the fix and passes after it.

The PSK server returned the secret for any identity. The client also
offers its resumption ticket as a PSK identity, and OpenSSL passes it
to pskCallback when its leading bytes read as a string, for example
when the random ticket key name starts with a NUL byte. The server then
used the ticket as an external PSK with the wrong key and failed the
binder check with decrypt_error, in about 0.7% of runs.

Only return the secret for the identity the client uses.

Refs: https://github.com/nodejs/node/actions/runs/43411330264/job/131838200960
Signed-off-by: Matteo Collina <hello@matteocollina.com>
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to Node.js core tests and test infrastructure. labels Nov 13, 2026

@gurgunday gurgunday left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@pimterry

Copy link
Copy Markdown
Member

This is already fixed by #67450

@codecov

codecov Bot commented Nov 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.71%. Comparing base (925faf4) to head (f3c7e88).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67458      +/-   ##
==========================================
+ Coverage   90.70%   90.71%   +0.01%     
==========================================
  Files         802      802              
  Lines      282109   282109              
  Branches    54364    54356       -8     
==========================================
+ Hits       255881   255923      +42     
+ Misses      16359    16318      -41     
+ Partials     9869     9868       -1     

see 31 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mcollina mcollina closed this Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. test Issues and PRs related to Node.js core tests and test infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants