test(vertex_ai): run the files peak-memory guards without coverage tracing (#42914)

The new CircleCI tests pipeline (#42773) runs tests/unit under pytest-cov on
CPython 3.12.2, where coverage traces every line through sys.settrace. The two
tracemalloc peak comparisons in test_vertex_ai_files_streaming.py drive 8000-row
payloads through both pipelines and slow from ~10s to over 3 minutes under that
tracer, so both hit the 90s pytest-timeout on every run.

Mark them no_cover so pytest-cov pauses tracing for just these two. Their
assertions are unchanged and every other test in the file still reports coverage.
This commit is contained in:
yuneng-jiang 2026-09-24 11:56:42 -07:00 • committed by GitHub
parent 342f9c3bf5
commit f4f1a75a9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -269,6 +269,7 @@ class TestStreamingPeakMemory:
measurement removes any garbage the previous run left behind.
"""
@pytest.mark.no_cover
def test_streaming_peak_well_below_list_pipeline(self):
cfg = VertexAIFilesConfig()
raw = _make_openai_jsonl_bytes(8000)
@ -345,6 +346,7 @@ class TestPathSourcedStreaming:
first_labels = json.loads(lines[0])["request"]["labels"]
assert _get_litellm_batch_custom_id_from_labels(first_labels) == "request-0"
@pytest.mark.no_cover
def test_path_source_peak_stays_below_list_pipeline(self, tmp_path):
cfg = VertexAIFilesConfig()
path, raw = self._write_jsonl(tmp_path, 8000)