colored-rs / colored

(Rust) Coloring terminal so simple you already know how to do it !

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`set_override` doesn't react immediately

neepl opened this issue · comments

commented

Hi! I'm using set_override to disable color output for my tests at their start and use unset_override at their end. Time to time tests could fail. The reason is I'm still getting colored output. Could this issue be related to Ordering::Relaxed memory ordering used in override methods?

Since tests are run in parallel, you're likely hitting a race condition. A few ways to work around that could include

commented

Thanks, probably missed that my tests are running in parallel. I've already fixed this with recommendation from colored's crate page: use "colored/no-color" feature for test.