-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
chore: move start_server
util in tests into a fixture
#8461
chore: move start_server
util in tests into a fixture
#8461
Conversation
|
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.
Some tests are failing with:
Test timeout of 45000ms exceeded while tearing down "start_server".
Also, I see load does ignore ttl if fetch cache options says so
flaking again, which I haven't seen flake at all since context.close()
was introduced. It's possible that we've just had a lucky run, but I'd want to see that it's failing in other tests before merging this
How do we know that context.close()
will be run before server.close()
with this PR?
Hmm — we don't. This change basically reverts the |
according to https://playwright.dev/docs/test-fixtures , context is a fixture too, but one provided by playwright. the default page (another fixture) belongs to that context so i'd assume they are only closing the context after the page fixture further down on that page they list the execution order https://playwright.dev/docs/test-fixtures#execution-order |
start_server
util in tests into a fixture
/** | ||
* @type {Set<import('net').Socket>} | ||
*/ | ||
let sockets; |
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.
it seemed to be working without all the socket craziness before. do we really need to add the extra complication?
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.
this is what i found as advice for force closing http.Server. I had logging locally and it actually does call socket.destroy in some cases, which should speed up the close at best and prevent timeouts at worst.
Given that this lives in a fixture and is out of the way for tests, not even used unless you actively call start_server(), i'd say it's worth it.
so we don't have to try/finally inside the tests and leave playwright created contexrt alone
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. All changesets should bepatch
until SvelteKit 1.0