marcoow / rust_rest

MIT License
5 stars 1 forks source link

Db cleanup #26

Closed marcoow closed 10 months ago

marcoow commented 10 months ago

This deletes the test-specific databases after each test run using a custom test macro.

closes #21

marcoow commented 10 months ago

I'm not quite sure why this doesn't work – all documentation I find seems to suggest I should use tokio's block_on but it fails with:

Cannot start a runtime from within a runtime. This happens because a function (like `block_on`) attempted to block the current thread while the thread is being used to drive asynchronous tasks.

@LukeMathWalker: if you find a second, maybe you can help 🙏

LukeMathWalker commented 10 months ago

tokio runtimes cannot be nested—block_on starts a new one under the hood, and since you're already in an async context (#[tokio::test]) it blows up 😞