standard-ai / ya-gcp

Apache License 2.0
7 stars 8 forks source link

Use `serial_test` rather than `--test-threads=1` #33

Open matthew-healy opened 1 year ago

matthew-healy commented 1 year ago

Currently tests/pubsub_client only works if you remember to pass --test-threads=1. Forgetting to do this caused me some confusion earlier today, as I couldn't work out whether something I changed had broken the tests.

In the past, I've used the serial_test crate to ensure that only a single test is able to run at a time, without having to remember to pass the --test-threads argument. This has the added bonus of ensuring that only the tests which cannot be run in parallel are run serially, which should lead to faster test runs in general.

(This isn't hard to do, but I don't have time to do it right now, so I'm documenting it here.)