November 21, 2022, 9:54pm
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.
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?
November 21, 2022, 10:24pm
Nevermind, for some reason now it works faster?
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.
November 22, 2022, 7:13am
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?
November 22, 2022, 10:01pm
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
November 23, 2022, 5:02am
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.
November 23, 2022, 7:09am
I am hashing password and I already configured less salt rounds for test
January 18, 2023, 10:17pm
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.
February 13, 2023, 2:28pm
I fixed it upgrading Erlang to the lastest version and avoiding dockers con M1.