https://github.com/timberio/vector/pull/3778#issuecomment-698622017 is still occasionally an issue in macOS CI tests. The interval fix I suggested in that thread seems to have fixed it locally, so I think this probably hints at it being a race condition of some kind.
I've isolated this failure to when the api tests are specifically run with 2 threads:
cargo test --test api -- --nocapture --test-threads 2
1 thread, or any number above 2 seems to pass consistently.
Interestingly, we have env RUST_TEST_THREADS=1 for our CI, does this means that RUST_TEST_THREADS not work?
RUST_TEST_THREADS works for me locally. I get the same (panicked) result with:
RUST_TEST_THREADS=2 cargo test --test api -- --nocapture
But not with any # other than 2.
Since CI is single threaded and is _still_ failing, the number of threads seems like a symptom rather than the cause of the problem. Will dig further.