-
Hi there 👋 I've been seeing some of our tests flake, due to vite ruby not being able to find the assets. The file is obviously there, as this code is running locally and in production without issues. Any ideas to what I might be missing here? I've added an example error below (with some details anonymised), but this seems to appear on different controller tests without much pattern to it.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi Robbe! I'd suggest trying to debug why the
|
Beta Was this translation helpful? Give feedback.
-
I can chime in here - in our case this was caused by running tests in parallel. We've been having intermittent errors as well and I finally dug into it this weekend... It happens when multiple tests trigger the vite build at the same time. Of course, the next time you run tests the vite build will be up to date and things work perfectly. I can make it happen by running this:
We are now trying to mitigate in several ways:
@ElMassimo any other clever ideas? Might be worth a mention in the docs at least. We love Vite Ruby! |
Beta Was this translation helpful? Give feedback.
I can chime in here - in our case this was caused by running tests in parallel. We've been having intermittent errors as well and I finally dug into it this weekend... It happens when multiple tests trigger the vite build at the same time. Of course, the next time you run tests the vite build will be up to date and things work perfectly.
I can make it happen by running this:
We are now trying to mitigate in several ways:
vite build
before tests (we use just so this is easy)