Skip to content

Commit e7731ee

Browse files
committed
try to deflake tests
1 parent b69b94d commit e7731ee

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

chromadb/test/property/test_add.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,30 @@
2121

2222
collection_st = st.shared(strategies.collections(with_hnsw_params=True), key="coll")
2323

24+
@given(
25+
collection=collection_st,
26+
record_set=strategies.recordsets(collection_st, min_size=1, max_size=5),
27+
)
28+
@settings(
29+
deadline=None,
30+
parent=override_hypothesis_profile(
31+
normal=hypothesis.settings(max_examples=500),
32+
fast=hypothesis.settings(max_examples=200),
33+
),
34+
)
35+
def test_add_miniscule(
36+
client: ClientAPI,
37+
collection: strategies.Collection,
38+
record_set: strategies.RecordSet,
39+
) -> None:
40+
if (
41+
client.get_settings().chroma_api_impl
42+
== "chromadb.api.async_fastapi.AsyncFastAPI"
43+
):
44+
pytest.skip(
45+
"TODO @jai, come back and debug why CI runners fail with async + sync"
46+
)
47+
_test_add(client, collection, record_set, True, always_compact=True)
2448

2549
# Hypothesis tends to generate smaller values so we explicitly segregate the
2650
# the tests into tiers, Small, Medium. Hypothesis struggles to generate large
@@ -104,6 +128,7 @@ def _test_add(
104128
record_set: strategies.RecordSet,
105129
should_compact: bool,
106130
batch_ann_accuracy: bool = False,
131+
always_compact: bool = False,
107132
) -> None:
108133
create_isolated_database(client)
109134

@@ -132,7 +157,7 @@ def _test_add(
132157
if (
133158
not NOT_CLUSTER_ONLY
134159
and should_compact
135-
and len(normalized_record_set["ids"]) > 10
160+
and (len(normalized_record_set["ids"]) > 10 or always_compact)
136161
):
137162
# Wait for the model to be updated
138163
wait_for_version_increase(client, collection.name, initial_version)

rust/worker/tilt_config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ compaction_service:
170170

171171
log_service:
172172
num_records_before_backpressure: 100000
173+
reinsert_threshold: 1
173174
opentelemetry:
174175
service_name: "rust-log-service"
175176
endpoint: "http://otel-collector:4317"

0 commit comments

Comments
 (0)