Skip to content

Ingest CI test execution stats#4191

Merged
pfcoperez merged 13 commits into
mainfrom
DBI-671/test/o11y/store-peerdb-ci-test-results-for-flake-analysis
Apr 20, 2026
Merged

Ingest CI test execution stats#4191
pfcoperez merged 13 commits into
mainfrom
DBI-671/test/o11y/store-peerdb-ci-test-results-for-flake-analysis

Conversation

@pfcoperez

@pfcoperez pfcoperez commented Apr 17, 2026

Copy link
Copy Markdown
Member

This PR adds a flow step to the repository build ingesting test results for internal analysis.

📝 So far, this is implemented as a step within this repository CI flow, it can be easily factored out as an action if we want to follow the same strategy in other repositories.

The step:

  1. Converts the go tests XML reports into NDJSON format using test-results.sh which is just a wrapper for a yq query.
  2. Uploads the NDJSON to a ClickHouse ingestion Query Endpoint. If the endpoint failes (no response, connection interrupted or status code >= 400), the upload is retried a up to 5 times with power-of-two exponential back-off.

This is done as the last step in the build so failures are not disruptive.

For internal reviewers

You should check the following details related to internal management of this data:

Ready when

  • Pipeline ingestion is tested.

What does this PR resolve?

Part of: https://linear.app/clickhouse/issue/DBI-671

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds ingestion of CI test execution results from the Flow workflow into an internal analytics endpoint for observability/analysis (DBI-671).

Changes:

  • Add a new GitHub Actions step in flow.yml to normalize JUnit XML into NDJSON and upload it to an external endpoint.
  • Introduce a new .github/scripts/test-results.sh script to transform JUnit XML into per-test NDJSON records enriched with workflow metadata.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 9 comments.

File Description
.github/workflows/flow.yml Adds a post-test step that normalizes JUnit XML and uploads NDJSON to an analytics endpoint, then checks uploaded row count.
.github/scripts/test-results.sh New yq/jq-based converter from JUnit XML to NDJSON with workflow metadata fields.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/flow.yml Outdated
Comment thread .github/scripts/test-results.sh Outdated
Comment thread .github/scripts/test-results.sh Outdated
Comment thread .github/scripts/test-results.sh Outdated
Comment thread .github/scripts/test-results.sh Outdated
Comment thread .github/workflows/flow.yml Outdated
Comment thread .github/workflows/flow.yml Outdated
Comment thread .github/scripts/test-results.sh Outdated
Comment thread .github/scripts/test-results.sh Outdated
pfcoperez and others added 3 commits April 17, 2026 22:23
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@codecov

codecov Bot commented Apr 17, 2026

Copy link
Copy Markdown

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
2215 2 2213 202
View the top 2 failed test(s) by shortest run time
github.com/PeerDB-io/peerdb/flow/e2e::TestSwitchboardPostgres/Test_QueryComplexity_WindowFunction
Stack Traces | 0s run time
=== RUN   TestSwitchboardPostgres/Test_QueryComplexity_WindowFunction
=== PAUSE TestSwitchboardPostgres/Test_QueryComplexity_WindowFunction
=== CONT  TestSwitchboardPostgres/Test_QueryComplexity_WindowFunction
    e2eshared.go:34: 
        	Error Trace:	.../flow/e2e/congen.go:44
        	            				.../flow/e2e/pg.go:190
        	            				.../flow/e2e/switchboard_pg_test.go:38
        	            				.../flow/e2eshared/e2eshared.go:34
        	Error:      	Received unexpected error:
        	            	unable to establish connection with catalog: FATAL: terminating connection due to administrator command (SQLSTATE 57P01)
        	Test:       	TestSwitchboardPostgres/Test_QueryComplexity_WindowFunction
--- FAIL: TestSwitchboardPostgres/Test_QueryComplexity_WindowFunction (0.00s)
github.com/PeerDB-io/peerdb/flow/e2e::TestSwitchboardPostgres
Stack Traces | 0.01s run time
=== RUN   TestSwitchboardPostgres
=== PAUSE TestSwitchboardPostgres
=== CONT  TestSwitchboardPostgres
--- FAIL: TestSwitchboardPostgres (0.01s)
2026/04/20 10:21:31 INFO Received AWS credentials from peer for connector: ci x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN}
2026/04/20 10:21:31 INFO Received AWS credentials from peer for connector: clickhouse x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN}
2026/04/20 10:21:31 INFO Executing and processing query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_mbh4gyhg.\"original\" ORDER BY id"
2026/04/20 10:21:31 INFO Executing and processing query stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_mbh4gyhg.\"original\" ORDER BY id"
2026/04/20 10:21:31 INFO [pg_query_executor] declared cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursorQuery="DECLARE peerdb_cursor_10689333627283282704 CURSOR FOR SELECT id,val FROM e2e_test_api_mbh4gyhg.\"original\" ORDER BY id" args=[]
2026/04/20 10:21:31 INFO [pg_query_executor] fetching rows start x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_mbh4gyhg.\"original\" ORDER BY id" channelLen=0
2026/04/20 10:21:31 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_10689333627283282704
2026/04/20 10:21:31 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_10689333627283282704 records=2 bytes=19 channelLen=1
2026/04/20 10:21:31 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_mbh4gyhg.\"original\" ORDER BY id" rows=2 bytes=19 channelLen=1
2026/04/20 10:21:31 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_10689333627283282704
2026/04/20 10:21:31 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_10689333627283282704 records=0 bytes=0 channelLen=0
2026/04/20 10:21:31 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_mbh4gyhg.\"original\" ORDER BY id" rows=0 bytes=0 channelLen=0
2026/04/20 10:21:31 INFO [pg_query_executor] committing transaction x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart
2026/04/20 10:21:31 INFO [pg_query_executor] committed transaction for query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_mbh4gyhg.\"original\" ORDER BY id" rows=2 bytes=19 channelLen=0

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: TestCancelTableAdditionRemoveAddRemove failed due to a PostgreSQL SQLSTATE 57P01 (admin_shutdown) error — a transient catalog connection termination by the database server, not a code bug.
Confidence: 0.93

✅ Automatically retrying the workflow

View workflow run

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: Both failures share the same root cause: the PostgreSQL catalog connection was killed mid-test by an administrator command (SQLSTATE 57P01), a transient CI infrastructure event unrelated to the code change.
Confidence: 0.97

✅ Automatically retrying the workflow

View workflow run

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: TestResyncCompleted failed due to PostgreSQL SQLSTATE 57P01 ("terminating connection due to administrator command") — an external connection kill unrelated to the code under test.
Confidence: 0.93

✅ Automatically retrying the workflow

View workflow run

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: TestGenericBQ/Test_Inheritance_Table_With_Dynamic_Setting timed out waiting for STATUS_SNAPSHOT to complete — a known flaky pattern under high CI concurrency, consistent with explicit comments in the test suite about BigQuery flakiness.
Confidence: 0.92

✅ Automatically retrying the workflow

View workflow run

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: The test TestPeerFlowE2ETestSuitePG_CH_Cluster/Test_Binary_Format_Base64 failed because the PostgreSQL catalog connection was forcibly terminated by an administrator command (SQLSTATE 57P01), a transient CI infrastructure issue unrelated to any code change.
Confidence: 0.93

✅ Automatically retrying the workflow

View workflow run

pfcoperez and others added 2 commits April 20, 2026 10:18
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: The test TestApiPg/TestEditTablesBeforeResync failed due to a PostgreSQL catalog connection being forcibly terminated by an external admin command (SQLSTATE 57P01 / admin_shutdown), which is a transient infrastructure failure unrelated to any code change.
Confidence: 0.95

✅ Automatically retrying the workflow

View workflow run

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: E2E test TestApiPg/TestCancelAddCancel timed out in a WaitFor polling loop waiting for async "initial load MV error messages" from a Temporal workflow, a classic flaky pattern in cancel/re-add table orchestration tests.
Confidence: 0.88

✅ Automatically retrying the workflow

View workflow run

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: CI infrastructure failure — Docker port 42002 was already in use on the runner when attempting to bind it for the toxiproxy container, preventing container startup before any tests ran.
Confidence: 0.97

✅ Automatically retrying the workflow

View workflow run

@pfcoperez pfcoperez self-assigned this Apr 20, 2026
@pfcoperez pfcoperez marked this pull request as ready for review April 20, 2026 10:59
@pfcoperez pfcoperez merged commit 4154230 into main Apr 20, 2026
20 of 23 checks passed
@pfcoperez pfcoperez deleted the DBI-671/test/o11y/store-peerdb-ci-test-results-for-flake-analysis branch April 20, 2026 20:07
Comment thread .github/scripts/test-results.sh
Comment thread .github/workflows/flow.yml
pfcoperez added a commit that referenced this pull request Apr 21, 2026
Two improvements following up
#4191

1. Include information on the sources versions matrix combination.
2. For PRs, the commit information is now the last commit pushed by the
author rather than the resulting commit from the automatic merge from
main.

---------

Co-authored-by: Ilia Demianenko <ilia.demianenko@clickhouse.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants