Skip to content

test: Fix flaky tests in versioned-routes.test.js#5765

Merged
mcollina merged 2 commits into
fastify:mainfrom
smartinio:fix-flaky-sget-test
Oct 24, 2024
Merged

test: Fix flaky tests in versioned-routes.test.js#5765
mcollina merged 2 commits into
fastify:mainfrom
smartinio:fix-flaky-sget-test

Conversation

@smartinio

Copy link
Copy Markdown
Contributor

The server tests in test/versioned-routes.test.js use sget and thus callback notation. This causes a race condition where the second callback (containing the done() call) runs before the first callback.

To fix, the second request was moved into the callback of the first request.

Checklist

@mcollina mcollina 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

@smartinio

Copy link
Copy Markdown
Contributor Author

@mcollina Thanks, feel free to merge as I don't have write access

@mcollina mcollina merged commit e17142f into fastify:main Oct 24, 2024
@github-actions

Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants