`mix test` taking abnormally long

After deploying my application to gigalixir (I believe; this may be the source of the problem but I’m not sure at all, though it doesn’t seem like it), running mix test on my local PC takes way longer than it used to. Before, it would take no more than 10 seconds, but now it takes over 20 minutes.

image

I thought maybe it would be the database, but if the wait time is mostly sync it doesn’t seem like it would be that.

Any insight on why this could be?

Nevermind, for some reason now it works faster?

Hi @hawkyre,

In the case it happens again, you can run mix test --slowest to identify the slowest tests. You might have a random condition which can dramatically slow your tests.

Regards,

3 Likes

Oh alright, thanks for that!

This is abnormally long indeed. I’d do git bisect between the last known point in time when tests were fast and when they started being super slow.

do you have a mac m1 by any chance?

nope i have a windows laptop with a ryzen 5900hx and an nvidia 3080 laptop GPU + 32gb ram, which is not a bad setup at all, so i don’t know what would be going wrong

Are you hashing passwords in your tests?

If so, configuring the hashing algorithm to do fewer rounds might help. Here are the instructions for Bcrypt.

I am hashing password and I already configured less salt rounds for test

I do, and I’m having this problem. Do you know some existing bug or problem concerning M1?

Just my own anecdotal experience that my m1 is faster at everything compared to my intel machines, excepting compiling and running Elixir/BEAM apps.

1 Like

I fixed it upgrading Erlang to the lastest version and avoiding dockers con M1.