Skip to content

Conversation

devbugging
Copy link
Collaborator

Remove excessive logging in the CI tests.

The PR removes mockery debug output as well as optimises the test failure output by removing empty test outputs as well as grouping test outputs, while still preserving all the failure log.

The log of a test failure was shrunk from ~6000 to ~500 lines.

Example how it was before:

....
 === RUN   TestExecutionState_MaxValueSize
  --- PASS: TestExecutionState_MaxValueSize (0.00s)
  === RUN   TestExecutionState_MaxKeySize
  --- PASS: TestExecutionState_MaxKeySize (0.00s)
  === RUN   TestExecutionState_MaxInteraction
  --- PASS: TestExecutionState_MaxInteraction (0.00s)
  === RUN   TestUnrestrictedNestedTransactionBasic
  --- PASS: TestUnrestrictedNestedTransactionBasic (0.00s)
  === RUN   TestUnrestrictedNestedTransactionDifferentMeterParams
  --- PASS: TestUnrestrictedNestedTransactionDifferentMeterParams (0.00s)
  === RUN   TestParseRestrictedNestedTransactionBasic
  --- PASS: TestParseRestrictedNestedTransactionBasic (0.00s)
  === RUN   TestRestartNestedTransaction
  --- PASS: TestRestartNestedTransaction (0.00s)
  === RUN   TestRestartNestedTransactionWithInvalidId
  --- PASS: TestRestartNestedTransactionWithInvalidId (0.00s)
  === RUN   TestUnrestrictedCannotCommitParseRestrictedNestedTransaction
  --- PASS: TestUnrestrictedCannotCommitParseRestrictedNestedTransaction (0.00s)
....

How it is now:

✓  access/validator (cached) (coverage: 55.1% of statements)
✓  admin/commands/common (cached) (coverage: 40.5% of statements)
✓  admin/commands/execution (cached) (coverage: 68.8% of statements)
✓  admin/commands/storage (cached) (coverage: 57.3% of statements)

While still the failure log looks like:

=== Failed
=== FAIL: network/p2p/inspector/validation TestControlMessageInspection_ValidRpc (1.00s)
    mock.go:361: 
        
        mock: Unexpected Method Call
        -----------------------------
        
        ByPeerID(peer.ID)
                        0: "\xc7=\x1dZ\xc0\xb4\xa0P\x85\xfd\xed4\x14\xaa-\x1b\x0f7M\xef\xd8^\x8cnX\x9f\xda\xe0j\x0f3\x99"
        
        The closest call I have is: 
        
        ByPeerID(peer.ID)
                        0: "\x00%\b\x02\x12!\x03\x01m\x1cB\xc0\xf18\xd9\xd1<6\xd5\xf3jE\xc4\x16\xecP\xc1\xb3Qy\xbdZ,_:\x82\v\t?"
        
        
        Diff: 0: FAIL:  (peer.ID=EQkBZAVe2vxwqZfdd1R9JZNr1UbJVbZhiw9Ggu8YBLoa) != (peer.ID=16Uiu2HAmCkZFoozN9Bp4zFr875zZan4z6ytCHJ1P5fNaqNwjoJvA)
        at: [/Users/gregorg/Dev/devbugging/flow-go/network/p2p/inspector/validation/control_message_validation_inspector.go:341 /Users/gregorg/Dev/devbugging/flow-go/network/p2p/inspector/validation/control_message_validation_inspector.go:706 /Users/gregorg/Dev/devbugging/flow-go/network/p2p/inspector/validation/control_message_validation_inspector.go:322 /Users/gregorg/Dev/devbugging/flow-go/engine/common/worker/worker_builder.go:135 /Users/gregorg/Dev/devbugging/flow-go/module/component/component.go:271 /usr/local/go/src/runtime/asm_arm64.s:1268]
    control_message_validation_inspector_test.go:351: 
                Error Trace:    /Users/gregorg/Dev/devbugging/flow-go/network/p2p/inspector/validation/control_message_validation_inspector_test.go:351
                Error:          Condition never satisfied
                Test:           TestControlMessageInspection_ValidRpc

=== FAIL: network/test/cohort1 TestNetworkTestSuite/TestEcho (0.21s)
    network_test.go:763: 
                Error Trace:    /Users/gregorg/Dev/devbugging/flow-go/network/test/cohort1/network_test.go:763
                                                        /Users/gregorg/Dev/devbugging/flow-go/network/underlay/network.go:778
                                                        /Users/gregorg/Dev/devbugging/flow-go/network/queue/queueWorker.go:21
                                                        /usr/local/go/src/runtime/asm_arm64.s:1268
                Error:          Received unexpected error:
                                failed to send message to 0798eeee4d9f3bea944584725e772f8f9f7ce88572015484a4d80b0ea31f5d39: failed to close the stream for 16Uiu2HAmRyMSNbPHHupj3KTkUPYiy1qrBy9mx9tFgHidA7J3y9HJ: stream reset
                Test:           TestNetworkTestSuite/TestEcho

=== FAIL: network/test/cohort1 TestNetworkTestSuite (9.42s)

@devbugging devbugging requested a review from a team as a code owner October 15, 2025 11:39
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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