Fix flaky TestCollector