Let me start by understanding the problem. There's a test `tests/test_sampler.py::test_sample_covers_every_tenant` that fails about one in four times on CI, but passes when rerun. I need to find out why it's not deterministic and fix it. Let me first look at the test and the sampler code.
{
"path": "tests/test_sampler.py"
}3 lines, 37 B
"""Tests for the request auditor's sampling helpers.
The sampler is random by design, so these assert the properties the auditor depends on
rather than one exact sample.
"""
from sampler import Request, retry_delays, sample_requests, tenant_counts
TENANTS = ("acme", "globex", "initech", "umbrella")
PER_TENANT = 10
SAMPLE_SIZE = 8
def make_requests() -> list[Request]:
"""Build a fleet with an equal number of requests per tenant."""
return [showing 16 of 54 lines