Skip to content

[CI] Clean up dead and broken CI test infrastructure - #8643

Open
janezpodhostnik wants to merge 1 commit into
masterfrom
janez/ci-test-cleanup
Open

[CI] Clean up dead and broken CI test infrastructure#8643
janezpodhostnik wants to merge 1 commit into
masterfrom
janez/ci-test-cleanup

Conversation

@janezpodhostnik

@janezpodhostnik janezpodhostnik commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Remove CI test infrastructure that is dead, broken, or deprecated, and fix two silent misconfigurations in the unit test workflow.

Changes

  • Delete flaky-test-monitor.yml: disabled on GitHub and broken since Mar 2024 (its matrix job referenced a script deleted in b99c6fd). Also delete the now-orphaned test-monitor-process-results composite action and tools/test_monitor (BigQuery result processors used only by that workflow).
  • test_matrix_generator: write the dynamic matrix to $GITHUB_OUTPUT instead of the deprecated ::set-output workflow command. Output payload is byte-identical to before.
  • ci.yml: upload coverage from the paths the insecure and integration module Makefiles actually write (./insecure/cover.out, ./integration/cover.out) instead of ./coverage.txt, which never existed in those jobs and was silently skipped via continue-on-error.
  • ci.yml: drop no-op VERBOSE=1 and GO_TEST_PACKAGES overrides from the install-tools steps.
  • Makefile: remove the benchmark and ci-benchmark targets. benchmark was shadowed by the integration/benchmark directory and silently did nothing; ci-benchmark pointed at a target that no longer exists. Both were TeamCity-era leftovers.
  • Update stale doc comments in the epoch test suites that referenced flaky-test-monitor.yml.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Chores
    • Removed flaky-test monitoring workflows, result processing, schemas, configurations, and related test fixtures.
    • Removed benchmark and CI benchmark commands.
  • Bug Fixes
    • Corrected coverage-report paths for insecure and integration test jobs.
    • Simplified CI test-tool installation steps.
  • Refactor
    • Updated test-matrix reporting to use modern workflow outputs, with clearer failure handling.
  • Documentation
    • Updated epoch-test setup guidance to reflect the streamlined CI configuration.

@janezpodhostnik
janezpodhostnik requested a review from a team as a code owner August 5, 2026 15:30
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

  • .github/workflows/flaky-test-monitor.yml

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change removes the flaky-test monitoring workflow and Go processing pipeline, updates CI test setup and coverage paths, migrates matrix output to GITHUB_OUTPUT, removes benchmark targets, and updates epoch-test documentation.

Changes

CI and test monitoring

Layer / File(s) Summary
GitHub Actions matrix output
tools/test_matrix_generator/matrix.go
printCIString writes the matrix to GITHUB_OUTPUT using the dynamicMatrix key and keeps stdout output for local use.
CI test setup and coverage paths
.github/workflows/ci.yml
Unit, insecure, and integration jobs use make install-tools. Codecov reads module-specific coverage files.
Monitoring and benchmark cleanup
.github/workflows/flaky-test-monitor.yml, tools/test_monitor/**, Makefile, integration/tests/epochs/*
The flaky-test monitoring workflow, processing pipeline, schemas, fixtures, and benchmark targets are removed. Epoch-test documentation no longer requires the monitoring workflow.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Suggested labels: Tech Debt

Suggested reviewers: peterargue, kay-zee, zhangchiqing

Sequence Diagram(s)

sequenceDiagram
  participant TestMatrixGenerator
  participant GITHUB_OUTPUT
  participant CIWorkflow
  TestMatrixGenerator->>GITHUB_OUTPUT: Write dynamicMatrix JSON
  GITHUB_OUTPUT->>CIWorkflow: Supply the generated test matrix
  CIWorkflow->>CIWorkflow: Run configured test jobs
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the removal and cleanup of dead or broken CI test infrastructure described in the pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch janez/ci-test-cleanup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@janezpodhostnik janezpodhostnik self-assigned this Aug 5, 2026
@codecov-commenter

codecov-commenter commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
tools/test_matrix_generator/matrix.go 0.00% 8 Missing ⚠️

📢 Thoughts on this report? Let us know!

@janezpodhostnik janezpodhostnik changed the title Clean up dead and broken CI test infrastructure [CI] Clean up dead and broken CI test infrastructure Aug 5, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tools/test_matrix_generator/matrix.go`:
- Around line 115-123: Update the GITHUB_OUTPUT write path in matrix.go so
failures in both the fmt.Fprintf call and the deferred file close are handled
explicitly instead of using panic(fmt.Errorf(...)). Route these fatal errors
through the repository’s irrecoverable API, and make sure the close error is
captured and reported even when the write succeeds. Keep the existing output
formatting and the OpenFile/Fprintf flow in the matrix generation logic intact.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 220c754e-e063-4a0c-86c9-f31702a388d7

📥 Commits

Reviewing files that changed from the base of the PR and between b73fea2 and 591a605.

📒 Files selected for processing (109)
  • .github/workflows/actions/test-monitor-process-results/action.yml
  • .github/workflows/ci.yml
  • .github/workflows/flaky-test-monitor.yml
  • Makefile
  • integration/tests/epochs/base_suite.go
  • integration/tests/epochs/dynamic_epoch_transition_suite.go
  • tools/test_matrix_generator/matrix.go
  • tools/test_monitor/common/config.go
  • tools/test_monitor/common/level1.go
  • tools/test_monitor/common/level2.go
  • tools/test_monitor/common/level3.go
  • tools/test_monitor/common/testdata/test_data.go
  • tools/test_monitor/common/utility.go
  • tools/test_monitor/level1/process_summary1_results.go
  • tools/test_monitor/level1/process_summary1_results_test.go
  • tools/test_monitor/level2/process_summary2_results.go
  • tools/test_monitor/level2/process_summary2_results_test.go
  • tools/test_monitor/level3/flaky-test-monitor.json
  • tools/test_monitor/level3/process_summary3_results.go
  • tools/test_monitor/level3/process_summary3_results_test.go
  • tools/test_monitor/schemas/skipped_tests_schema.json
  • tools/test_monitor/schemas/test_results_schema.json
  • tools/test_monitor/testdata/summary1/raw/test-result-crypto-hash-1-count-fail.json
  • tools/test_monitor/testdata/summary1/raw/test-result-crypto-hash-1-count-pass.json
  • tools/test_monitor/testdata/summary1/raw/test-result-crypto-hash-1-count-skip-pass.json
  • tools/test_monitor/testdata/summary1/raw/test-result-crypto-hash-10-count-fail.json
  • tools/test_monitor/testdata/summary1/raw/test-result-crypto-hash-10-count-pass.json
  • tools/test_monitor/testdata/summary1/raw/test-result-crypto-hash-2-count-pass.json
  • tools/test_monitor/testdata/summary1/raw/test-result-exception-others-normal-3-count-pass.json
  • tools/test_monitor/testdata/summary1/raw/test-result-exception-single-1-count-pass.json
  • tools/test_monitor/testdata/summary1/raw/test-result-exception-single-5-count-4-nil-1-normal-pass.json
  • tools/test_monitor/testdata/summary1/raw/test-result-exception-single-5-count-pass.json
  • tools/test_monitor/testdata/summary2/test1-1package-1failure/expected-output/failures/TestSanitySha3_256+github.com-onflow-crypto-hash/failure1.txt
  • tools/test_monitor/testdata/summary2/test1-1package-1failure/expected-output/test1-1package-1failure.json
  • tools/test_monitor/testdata/summary2/test1-1package-1failure/input/test-result-crypto-hash-1-count-fail.json
  • tools/test_monitor/testdata/summary2/test2-1-exception/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception1.txt
  • tools/test_monitor/testdata/summary2/test2-1-exception/expected-output/test2-1-exception.json
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception1.txt
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception10.txt
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception11.txt
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception12.txt
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception13.txt
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception2.txt
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception3.txt
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception4.txt
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception5.txt
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception6.txt
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception7.txt
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception8.txt
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception9.txt
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/test3-multi-exceptions.json
  • tools/test_monitor/testdata/summary2/test4-multi-failures/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure1.txt
  • tools/test_monitor/testdata/summary2/test4-multi-failures/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure10.txt
  • tools/test_monitor/testdata/summary2/test4-multi-failures/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure2.txt
  • tools/test_monitor/testdata/summary2/test4-multi-failures/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure3.txt
  • tools/test_monitor/testdata/summary2/test4-multi-failures/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure4.txt
  • tools/test_monitor/testdata/summary2/test4-multi-failures/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure5.txt
  • tools/test_monitor/testdata/summary2/test4-multi-failures/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure6.txt
  • tools/test_monitor/testdata/summary2/test4-multi-failures/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure7.txt
  • tools/test_monitor/testdata/summary2/test4-multi-failures/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure8.txt
  • tools/test_monitor/testdata/summary2/test4-multi-failures/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure9.txt
  • tools/test_monitor/testdata/summary2/test4-multi-failures/expected-output/failures/TestSanitySha3_256+github.com-onflow-crypto-hash/failure1.txt
  • tools/test_monitor/testdata/summary2/test4-multi-failures/expected-output/test4-multi-failures.json
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception1.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception10.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception11.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception12.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception13.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception2.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception3.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception4.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception5.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception6.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception7.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception8.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception9.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure1.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure10.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure2.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure3.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure4.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure5.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure6.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure7.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure8.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure9.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/failures/TestSanitySha3_256+github.com-onflow-crypto-hash/failure1.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/test5-multi-failures-multi-exceptions.json
  • tools/test_monitor/testdata/summary3/test1-1package-1failure/expected-output/test1-1package-1failure.json
  • tools/test_monitor/testdata/summary3/test1-1package-1failure/input/flaky-test-monitor.json
  • tools/test_monitor/testdata/summary3/test1-1package-1failure/input/test1-1package-1failure.json
  • tools/test_monitor/testdata/summary3/test2-1-exception/expected-output/test2-1-exception.json
  • tools/test_monitor/testdata/summary3/test2-1-exception/input/flaky-test-monitor.json
  • tools/test_monitor/testdata/summary3/test2-1-exception/input/test2-1-exception.json
  • tools/test_monitor/testdata/summary3/test3-multi-exceptions/expected-output/test3-multi-exceptions.json
  • tools/test_monitor/testdata/summary3/test3-multi-exceptions/input/flaky-test-monitor.json
  • tools/test_monitor/testdata/summary3/test3-multi-exceptions/input/test3-multi-exceptions.json
  • tools/test_monitor/testdata/summary3/test4-multi-failures/expected-output/test4-multi-failures.json
  • tools/test_monitor/testdata/summary3/test4-multi-failures/input/flaky-test-monitor.json
  • tools/test_monitor/testdata/summary3/test4-multi-failures/input/test4-multi-failures.json
  • tools/test_monitor/testdata/summary3/test5-multi-durations/expected-output/test5-multi-durations.json
  • tools/test_monitor/testdata/summary3/test5-multi-durations/input/flaky-test-monitor.json
  • tools/test_monitor/testdata/summary3/test5-multi-durations/input/test5-multi-durations.json
  • tools/test_monitor/testdata/summary3/test6-multi-failures-cap/expected-output/test6-multi-failures-cap.json
  • tools/test_monitor/testdata/summary3/test6-multi-failures-cap/input/flaky-test-monitor.json
  • tools/test_monitor/testdata/summary3/test6-multi-failures-cap/input/test6-multi-failures-cap.json
  • tools/test_monitor/testdata/summary3/test7-multi-durations-cap/expected-output/test7-multi-durations-cap.json
  • tools/test_monitor/testdata/summary3/test7-multi-durations-cap/input/flaky-test-monitor.json
  • tools/test_monitor/testdata/summary3/test7-multi-durations-cap/input/test7-multi-durations-cap.json
💤 Files with no reviewable changes (105)
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception4.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception5.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception9.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception6.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception11.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception13.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception1.txt
  • tools/test_monitor/testdata/summary2/test4-multi-failures/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure9.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception12.txt
  • tools/test_monitor/testdata/summary3/test5-multi-durations/input/flaky-test-monitor.json
  • tools/test_monitor/testdata/summary3/test7-multi-durations-cap/input/flaky-test-monitor.json
  • tools/test_monitor/testdata/summary3/test3-multi-exceptions/input/flaky-test-monitor.json
  • tools/test_monitor/testdata/summary2/test4-multi-failures/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure7.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure2.txt
  • tools/test_monitor/testdata/summary1/raw/test-result-crypto-hash-2-count-pass.json
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception3.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception2.txt
  • tools/test_monitor/testdata/summary3/test5-multi-durations/input/test5-multi-durations.json
  • tools/test_monitor/testdata/summary3/test3-multi-exceptions/input/test3-multi-exceptions.json
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception7.txt
  • tools/test_monitor/testdata/summary3/test1-1package-1failure/input/test1-1package-1failure.json
  • tools/test_monitor/testdata/summary3/test6-multi-failures-cap/input/flaky-test-monitor.json
  • tools/test_monitor/testdata/summary3/test7-multi-durations-cap/expected-output/test7-multi-durations-cap.json
  • tools/test_monitor/testdata/summary3/test1-1package-1failure/input/flaky-test-monitor.json
  • tools/test_monitor/testdata/summary3/test5-multi-durations/expected-output/test5-multi-durations.json
  • tools/test_monitor/testdata/summary3/test2-1-exception/expected-output/test2-1-exception.json
  • tools/test_monitor/testdata/summary1/raw/test-result-crypto-hash-1-count-pass.json
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception1.txt
  • tools/test_monitor/testdata/summary2/test2-1-exception/expected-output/test2-1-exception.json
  • tools/test_monitor/testdata/summary1/raw/test-result-crypto-hash-1-count-fail.json
  • tools/test_monitor/testdata/summary1/raw/test-result-exception-single-1-count-pass.json
  • tools/test_monitor/testdata/summary2/test4-multi-failures/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure8.txt
  • tools/test_monitor/testdata/summary2/test4-multi-failures/expected-output/failures/TestSanitySha3_256+github.com-onflow-crypto-hash/failure1.txt
  • tools/test_monitor/testdata/summary1/raw/test-result-exception-single-5-count-4-nil-1-normal-pass.json
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception8.txt
  • tools/test_monitor/testdata/summary1/raw/test-result-crypto-hash-10-count-fail.json
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception3.txt
  • tools/test_monitor/testdata/summary2/test4-multi-failures/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure2.txt
  • tools/test_monitor/testdata/summary3/test1-1package-1failure/expected-output/test1-1package-1failure.json
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure5.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure7.txt
  • tools/test_monitor/testdata/summary2/test4-multi-failures/expected-output/test4-multi-failures.json
  • tools/test_monitor/testdata/summary2/test1-1package-1failure/expected-output/failures/TestSanitySha3_256+github.com-onflow-crypto-hash/failure1.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure8.txt
  • tools/test_monitor/testdata/summary2/test1-1package-1failure/expected-output/test1-1package-1failure.json
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception9.txt
  • tools/test_monitor/schemas/test_results_schema.json
  • tools/test_monitor/testdata/summary2/test2-1-exception/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception1.txt
  • tools/test_monitor/testdata/summary3/test4-multi-failures/input/flaky-test-monitor.json
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/test3-multi-exceptions.json
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception4.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception10.txt
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception6.txt
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception2.txt
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception7.txt
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception11.txt
  • tools/test_monitor/testdata/summary3/test3-multi-exceptions/expected-output/test3-multi-exceptions.json
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure1.txt
  • tools/test_monitor/testdata/summary3/test4-multi-failures/input/test4-multi-failures.json
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/failures/TestSanitySha3_256+github.com-onflow-crypto-hash/failure1.txt
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception5.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure9.txt
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception12.txt
  • tools/test_monitor/testdata/summary1/raw/test-result-exception-others-normal-3-count-pass.json
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception13.txt
  • tools/test_monitor/testdata/summary3/test6-multi-failures-cap/expected-output/test6-multi-failures-cap.json
  • tools/test_monitor/testdata/summary1/raw/test-result-crypto-hash-1-count-skip-pass.json
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception8.txt
  • tools/test_monitor/testdata/summary1/raw/test-result-exception-single-5-count-pass.json
  • tools/test_monitor/testdata/summary3/test2-1-exception/input/test2-1-exception.json
  • tools/test_monitor/schemas/skipped_tests_schema.json
  • tools/test_monitor/testdata/summary3/test6-multi-failures-cap/input/test6-multi-failures-cap.json
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure6.txt
  • tools/test_monitor/testdata/summary3/test2-1-exception/input/flaky-test-monitor.json
  • tools/test_monitor/common/config.go
  • tools/test_monitor/testdata/summary2/test3-multi-exceptions/expected-output/exceptions/TestEncodableRandomBeaconPrivKeyMsgPack+github.com-onflow-flow-go-model-encodable/exception10.txt
  • tools/test_monitor/testdata/summary2/test4-multi-failures/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure1.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/test5-multi-failures-multi-exceptions.json
  • tools/test_monitor/common/level1.go
  • tools/test_monitor/testdata/summary2/test4-multi-failures/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure5.txt
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure4.txt
  • tools/test_monitor/level3/process_summary3_results.go
  • tools/test_monitor/testdata/summary3/test4-multi-failures/expected-output/test4-multi-failures.json
  • tools/test_monitor/testdata/summary2/test4-multi-failures/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure6.txt
  • Makefile
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure10.txt
  • tools/test_monitor/level3/flaky-test-monitor.json
  • tools/test_monitor/testdata/summary2/test4-multi-failures/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure4.txt
  • tools/test_monitor/common/level2.go
  • tools/test_monitor/common/utility.go
  • tools/test_monitor/common/level3.go
  • tools/test_monitor/level3/process_summary3_results_test.go
  • tools/test_monitor/testdata/summary2/test5-multi-failures-multi-exceptions/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure3.txt
  • tools/test_monitor/testdata/summary2/test1-1package-1failure/input/test-result-crypto-hash-1-count-fail.json
  • tools/test_monitor/level2/process_summary2_results.go
  • .github/workflows/actions/test-monitor-process-results/action.yml
  • .github/workflows/flaky-test-monitor.yml
  • tools/test_monitor/level1/process_summary1_results.go
  • tools/test_monitor/testdata/summary1/raw/test-result-crypto-hash-10-count-pass.json
  • tools/test_monitor/common/testdata/test_data.go
  • tools/test_monitor/level1/process_summary1_results_test.go
  • tools/test_monitor/level2/process_summary2_results_test.go
  • tools/test_monitor/testdata/summary2/test4-multi-failures/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure3.txt
  • tools/test_monitor/testdata/summary3/test7-multi-durations-cap/input/test7-multi-durations-cap.json
  • tools/test_monitor/testdata/summary2/test4-multi-failures/expected-output/failures/TestSanitySha2_256+github.com-onflow-crypto-hash/failure10.txt

Comment on lines +115 to +123
f, err := os.OpenFile(outputFile, os.O_APPEND|os.O_WRONLY, 0o644)
if err != nil {
panic(fmt.Errorf("failed to open GITHUB_OUTPUT file: %w", err))
}
defer f.Close()
// the compacted JSON is a single line, so the simple name=value format is sufficient (no multiline delimiter needed)
if _, err := fmt.Fprintf(f, "%s=%s\n", ciMatrixName, b); err != nil {
panic(fmt.Errorf("failed to write test matrix to GITHUB_OUTPUT: %w", err))
}

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.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n -C 3 '\birrecoverable\b|panic\(fmt\.Errorf|\.Close\(\)' --glob '*.go'

Repository: onflow/flow-go

Length of output: 152


🏁 Script executed:

#!/bin/bash
set -u

echo "== tracked Go files candidates =="
git ls-files '*.go' | sed -n '1,80p'

echo
echo "== locate matrix.go and irrecoverable =="
fd -a 'matrix\.go|irrecoverable|component\.go|GoDocs|CodingConventions' . 2>/dev/null | sed -n '1,120p'

echo
echo "== search irrecoverable package references (all files) =="
rg -n -C 2 'irrecoverable|panic\(fmt\.Errorf|\\.Close\\(\\)' . --glob '*.go' 2>/dev/null | sed -n '1,200p'

Repository: onflow/flow-go

Length of output: 18083


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== matrix.go =="
cat -n tools/test_matrix_generator/matrix.go | sed -n '1,180p'

echo
echo "== module/irrecoverable API =="
cat -n module/irrecoverable/irrecoverable.go | sed -n '1,220p'

echo
echo "== module/component Component interface =="
cat -n module/component/component.go | sed -n '1,220p'

echo
echo "== deterministic Go output/close/error handling references from stdlib docs/source if available =="
if command -v go >/dev/null 2>&1; then
  go doc os.OpenFile 2>/dev/null | sed -n '1,120p'
  echo
  go doc os.File.Close 2>/dev/null | sed -n '1,120p'
else
  echo "go command unavailable"
fi

Repository: onflow/flow-go

Length of output: 22818


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import tempfile
import os
import subprocess

tmp = tempfile.mkdtemp()
f = os.path.join(tmp, "g")
os.close(os.open(f, os.O_WRONLY | os.O_CREAT, 0o644))
os.chmod(tmp, 0o000)  # parent dir unreadable prevents append create/close path
p = subprocess.run(
    ["go", "run", "-"],
    input=f"""
package main
import (
    "fmt"
    "os"
)
func main() {{
    file, err := os.OpenFile({f!r}, os.O_APPEND|os.O_WRONLY, 0o644)
    if err != nil {{
        fmt.Println("open_err=", err)
        return
    }}
    fmt.Println("open_ok")
    n, werr := fmt.Fprintln(file, "x")
    fmt.Printf("write_n=%d write_err=%v\\n", n, werr)
    cerr := file.Close()
    fmt.Printf("close_err=%v\\n", cerr)
}}
""",
    capture_output=True,
    text=True,
)
print(p.stdout, p.stderr)
print("returncode=", p.returncode)

# Show write-only-file Close error on fd that accepts data but has no name to flush.
fd = os.open(f, os.O_WRONLY | os.O_CREAT | os.O_APPEND, 0o644)
p2 = subprocess.run(
    ["go", "run", "-"],
    input=f"""
package main
import (
    "fmt"
    "os"
)
func main() {{
    file := os.NewFile({fd}, "")
    n, werr := fmt.Fprintln(file, "x")
    fmt.Printf("write_n=%d write_err=%v\\n", n, werr)
    cerr := file.Close()
    fmt.Printf("close_err=%v\\n", cerr)
}}
""",
    capture_output=True,
    text=True,
)
print(p2.stdout, p2.stderr)
print("writeonly_returncode=", p2.returncode)
PY

Repository: onflow/flow-go

Length of output: 333


🌐 Web query:

Go os.File Close documentation writes pending data return error

💡 Result:

Yes, os.File.Close can return an error if pending data writes fail [1][2]. In Go, when you write data to a file, the operating system may buffer that data in memory rather than writing it immediately to the underlying storage medium [1][2]. Consequently, an error that occurs during the actual flushing of these buffers—such as a disk I/O error or a failure to commit data—might not be surfaced until the file is closed or explicitly synchronized [1][2]. Because os.File.Close handles the final release of the file descriptor and can trigger the flushing of these remaining buffers, it is a critical point for error reporting [3][1][2]. If you ignore the error returned by Close (for example, by using defer f.Close without capturing the error), you may fail to detect that data was not successfully persisted [3][1]. To ensure data integrity when writing to files: 1. Always check the error returned by Close [1]. 2. If it is critical to know that data has been safely flushed to the physical device before closing, consider calling f.Sync before Close [3][1][2]. Sync forces the operating system to flush its write buffers for the file to the underlying storage [3][1]. Any error returned by Sync should also be checked [3][1].

Citations:


Handle all GITHUB_OUTPUT errors explicitly.

A deferred f.Close() can still fail after fmt.Fprintf; capturing and reporting both write and close errors prevents a failed matrix write from exiting successfully. For the required Go exception handling, route these fatal failures through the repository's irrecoverable API instead of panic(fmt.Errorf(...)).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tools/test_matrix_generator/matrix.go` around lines 115 - 123, Update the
GITHUB_OUTPUT write path in matrix.go so failures in both the fmt.Fprintf call
and the deferred file close are handled explicitly instead of using
panic(fmt.Errorf(...)). Route these fatal errors through the repository’s
irrecoverable API, and make sure the close error is captured and reported even
when the write succeeds. Keep the existing output formatting and the
OpenFile/Fprintf flow in the matrix generation logic intact.

Source: Coding guidelines

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.

2 participants