fix: improve ClickHouse CI reliability and reduce flakiness#7092
Open
AntoineToussaint wants to merge 9 commits intomainfrom
Open
fix: improve ClickHouse CI reliability and reduce flakiness#7092AntoineToussaint wants to merge 9 commits intomainfrom
AntoineToussaint wants to merge 9 commits intomainfrom
Conversation
- Replace hardcoded sleep() calls with deterministic poll_for_result() in clickhouse.rs, inference_clickhouse.rs, and test_helpers.rs - Increase default poll timeout from 5s to 30s to handle CI load - Use unique ClickHouse databases per embedded gateway test for isolation - sleep_for_writes_to_be_visible() now calls flush_pending_writes() instead of sleeping 500ms, benefiting 26+ test files Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
virajmehta
previously approved these changes
Mar 27, 2026
Tests like DICL optimizer and evaluation tests rely on fixture data pre-loaded into the shared `tensorzero_e2e_tests` database. Using unique databases per embedded gateway breaks these tests. The `make_embedded_gateway_e2e_with_unique_db()` helper remains available for tests that explicitly opt into isolation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
virajmehta
previously approved these changes
Mar 27, 2026
…DICL tests - Evaluation tests: retry feedback calls that validate evaluator_inference_id exists in ClickHouse, since the evaluator inferences may not be visible yet after flush. - DICL workflow test: create write_haiku inferences before launching optimization, instead of relying on other tests having run first. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
InputMessageContent::Text takes a Text struct, not a JSON value. write_haiku expects Template input with topic argument. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The mock-optimization-tests don't have a provider-proxy for inference calls, so creating inferences hits the real OpenAI API with a dummy key. Switch to dataset-based data source (like run_workflow_test_case_with_dataset) which creates datapoints directly without needing inference. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The materialized view ModelProviderStatisticsView may not be processing inserts at this point in the migration sequence. Poll the source table (ModelInference) instead, since the migration backfill reads from there. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sleep()calls with deterministicpoll_for_result()inclickhouse.rs,inference_clickhouse.rs, andtest_helpers.rs— tests now poll until data appears instead of hoping a fixed delay is enoughmake_embedded_gateway_with_config_path()and friends now callcreate_unique_clickhouse_url()instead of sharingtensorzero_e2e_tests, preventing test interferencesleep_for_writes_to_be_visible()now callsflush_pending_writes()instead of sleeping 500ms, benefiting 26+ test filesTest plan
batch_writes: trueandbatch_writes: false) passes without flaky failuresclickhouse.rspass (materialized view polling replaces sleeps)test_clickhouse_bulk_insertpasses (polls for 10k inferences instead of sleeping 10s)test_dummy_only_replicated_clickhousepasses with unique DB isolationtest_materialized_views_have_snapshot_hashpasses (polls InferenceById MV)🤖 Generated with Claude Code