henrik / progress_bar

Command-line progress bars and spinners for Elixir.
MIT License
329 stars 20 forks source link

Fix the non-deterministic tests #18

Open kelvinst opened 6 years ago

kelvinst commented 6 years ago

So, there are some tests that randomly fail. I guess that's because they test based on time span, and sometimes the spinner does not render the quantity it was expected to.

Going deeper: the processor is busy doing something else and the AnimationServer depends on it to process the :tick message.

Any idea of what could we do to make sure this kind of feature is working?

Maybe we should not test the timing for spinners at all, only test if it prints at least one step, then any quantity of other steps, and finally the conclusion step.

kelvinst commented 6 years ago

It could even make the tests a little faster. 🤣

henrik commented 6 years ago

I agree this sucks :) I think I like your idea of checking for some of the steps but maybe not requiring each and every one of them. I'll leave this ticket open and might look at it when things are less busy. Or if anyone wants to make a PR, feel free.