volt icon indicating copy to clipboard operation
volt copied to clipboard

Unexpected long waiting time when testing components with Volt

Open mondesirm opened this issue 9 months ago • 1 comments

Volt Version

1.7

Laravel Version

12.2

PHP Version

8.4.5

Database Driver & Version

SQLite / MySQL 8.4.3

Description

Here's the context:

The tests are fast enough overall, I was going to make a PR to their repo but I realised the following:

  • Each time I run pest, the first test running and using Volt::test always takes more than 20s.
  • Following tests (using Volt::test or not) are fast as expected.

Using a clean installation (filtering the tests so we have small examples to work with):

Image

Indeed, the test at the very top uses Volt.


Now, changing the order a bit:

Image

In this case, the first test in the list using Volt::test is "reset password link can be requested" (can be found here). This time, the execution time was 27.32s instead of 0.22s (in the first screenshot).

Is it expected behavior? Does Volt need a first long initialisation so the other tests can run lightning fast?

Love Volt so far btw.

Steps To Reproduce

  1. Install Laravel's Livewire Starter Kit (+ Volt) using Herd.
  2. Run pest in the terminal once it's ready.
  3. Expect an odd waiting time, if not I am crazy or it's time to get a new PC.

mondesirm avatar Apr 04 '25 17:04 mondesirm

Un-Volt-ing my tests like so do make my test suites run faster:

Image

But all my tests become lengthier and I lose the convenience that Volt offers with the chained assertions among other things.

mondesirm avatar Apr 04 '25 18:04 mondesirm