MrBBot
CDCloudflare Developers
•Created by Hebilicious on 4/8/2024 in #vitest-integration-beta
Hey, does anyone know how to use `export
Hey! 👋 There's a PR up to add support for this: https://github.com/cloudflare/workers-sdk/pull/5508. I'm not at Cloudflare anymore, but hopefully someone on the team will get this over the line soon. 🙂
6 replies
CDCloudflare Developers
•Created by Walshy on 4/1/2024 in #vitest-integration-beta
Slow R2 puts
Hey! 👋 Not too sure. Is it the test that's taking a while, or the
put()
call specifically? If it's the test as a whole, I suspect this is more related to the performance of isolated storage: https://github.com/cloudflare/workers-sdk/issues/5395. Could you try disable that with isolatedStorage: false
and see if that improves things?1 replies
CDCloudflare Developers
•Created by Vincent on 3/29/2024 in #vitest-integration-beta
Hey Cloudflare team! We're making great
There's this open issue on
workerd
about segfaults with hibernation, I suspect this is related: https://github.com/cloudflare/workerd/issues/142234 replies
CDCloudflare Developers
•Created by Vincent on 3/29/2024 in #vitest-integration-beta
Hey Cloudflare team! We're making great
Maybe it's more likely a bug inside workerd
itself?
Yeah, that seems likely. I'm actually going to be leaving Cloudflare tomorrow so probably won't have time to personally look into this. GitHub issues are probably the best way to track this though.34 replies
CDCloudflare Developers
•Created by Vincent on 4/2/2024 in #vitest-integration-beta
Is there a workaround that will let me
Hey! 👋 I think this might be impossible to test unfortunately. 😦 Thanks for the reproduction though. Will see if I can get that looked at. 👍
5 replies
CDCloudflare Developers
•Created by Vincent on 3/29/2024 in #vitest-integration-beta
Hey Cloudflare team! We're making great
If you could still create a GitHub issue for this though that would be great. 🙂
34 replies
CDCloudflare Developers
•Created by Vincent on 3/29/2024 in #vitest-integration-beta
Hey Cloudflare team! We're making great
This is because we reset storage after each retry, but the
onAfterTryTask()
hook fires before afterEach()
34 replies
CDCloudflare Developers
•Created by Vincent on 3/29/2024 in #vitest-integration-beta
Hey Cloudflare team! We're making great
That doesn't feel right 🤔
34 replies
CDCloudflare Developers
•Created by Vincent on 3/29/2024 in #vitest-integration-beta
Hey Cloudflare team! We're making great
Hmmm, yeah it looks like that's the case 😦
34 replies
CDCloudflare Developers
•Created by Vincent on 3/29/2024 in #vitest-integration-beta
Hey Cloudflare team! We're making great
Yeah, my guess is that
abortAllDurableObjects()
isn't cleaning up Durable Objects properly (i.e. it doesn't stop all in-progress WebSocket messages), and the 2nd ws.send()
ends up accessing something that's been freed somehow.34 replies
CDCloudflare Developers
•Created by Vincent on 3/29/2024 in #vitest-integration-beta
Hey Cloudflare team! We're making great
But it sounds like this might've unblocked you?
34 replies
CDCloudflare Developers
•Created by Vincent on 3/29/2024 in #vitest-integration-beta
Hey Cloudflare team! We're making great
Very interesting... ok, so this is some sort of bug in
abortAllDurableObjects()
🤔34 replies
CDCloudflare Developers
•Created by Vincent on 3/29/2024 in #vitest-integration-beta
Hey Cloudflare team! We're making great
Yeah, if you replace the
runInDurableObject(...)
with import unsafe from "workerd:unsafe"; await unsafe.abortAllDurableObjects()
does that still work?34 replies
CDCloudflare Developers
•Created by Vincent on 3/29/2024 in #vitest-integration-beta
Hey Cloudflare team! We're making great
Ok yeah, that's super weird 😅 my guess is this is related to us aborting all Durable Objects after all tests (and after each test when isolated storage is enabled). I just checked, and that
ECONNREFUSED
is coming from this fetch()
call: https://github.com/cloudflare/workers-sdk/blob/1af469af63616a60c88752e1e170cfa59d41b1cd/packages/vitest-pool-workers/src/pool/loopback.ts#L203. I wonder if you do that await runInDurableObject(stub, (_, state) => state.blockConcurrencyWhile(() => { throw new Error() }));
trick at the end of your test to abort the object yourself it fixes things?34 replies
CDCloudflare Developers
•Created by Vincent on 3/29/2024 in #vitest-integration-beta
Hey Cloudflare team! We're making great
(
__console
is just console
without Vitest patching)34 replies
CDCloudflare Developers
•Created by Vincent on 3/29/2024 in #vitest-integration-beta
Hey Cloudflare team! We're making great
Maybe
__console.log(arguments)
within them just to see if they're called with anything useful?34 replies
CDCloudflare Developers
•Created by Vincent on 3/29/2024 in #vitest-integration-beta
Hey Cloudflare team! We're making great
Ok no worries. If you can open a GitHub issue with your original message, I can add this to my list. 👍 One other quick thing to try, does adding
webSocketError()
and webSocketClose()
handlers to your Demo
object change anything?34 replies