Page MenuHomePhabricator

[Chronik] Fixing sync issue between websocket.rs and chronik-clieint_websocket.py steps
ClosedPublic

Authored by hazzarust on Jul 7 2025, 16:12.

Details

Reviewers
Fabien
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Commits
rABCb31b9fe157b0: [Chronik] Fixing sync issue between websocket.rs and chronik-clieint_websocket.
Summary

Made changes to re-sync the python steps with the rust steps.
The numbering on the python steps were also out (skipped from 5 -> 8), this has been fixed.
After this is landed, I will aim to get the failover approved.

Test Plan

Please set BUILD_DIR env to export BUILD_DIR="/path/to/build_dir
UNIX: ./contrib/teamcity/build-configurations.py build-bitcoinsuite-chronik-client
run cargo test -- --nocapture in bitcoin-abc/modules/bitcoinsuite-chronik-client/tests

Event Timeline

Owners added a reviewer: Restricted Owners Package.Jul 7 2025, 16:12
hazzarust retitled this revision from [Chronik] Fixing chronik-client_websocket.py steps and aligning Rust websocket.rs to [Chronik] Fixing chronik-client_websocket.py steps and aligning rust websocket.rs.
hazzarust edited the summary of this revision. (Show Details)
hazzarust retitled this revision from [Chronik] Fixing chronik-client_websocket.py steps and aligning rust websocket.rs to [Chronik] Fixing sync issue between websocket.rs and chronik-clieint_websocket.py steps.

@bot chronik-client-integration-tests

Tail of the build log:

Test runner for chronik-client_websocket started
2025-07-07T19:47:31.464000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_₿₵_🏃_20250707_194731_5732/setup_scripts/chronik-client_websocket_0
2025-07-07T19:47:32.706000Z TestFramework (INFO): Passed test setup data to mocha
chronikUrl set to ["http://127.0.0.1:26000"]
Mocha timeout set to 240 seconds
2025-07-07T19:47:40.061000Z TestFramework (INFO): Step 1: Avalanche finalize a block
2025-07-07T19:47:42.516000Z TestFramework (INFO): Step 2: Broadcast 1 tx to a p2pk, p2pkh, and p2sh address
2025-07-07T19:47:43.560000Z TestFramework (INFO): Step 3: Mine a block with these txs
2025-07-07T19:47:43.566000Z TestFramework (INFO): Step 4: Finalize the block containing these txs with Avalanche
2025-07-07T19:47:46.041000Z TestFramework (INFO): Step 5: Park the block containing those txs
2025-07-07T19:47:46.045000Z TestFramework (INFO): Step 6: Unpark the block containing those txs
2025-07-07T19:47:46.050000Z TestFramework (INFO): Step 7: Manually invalidate the block containing those txs
2025-07-07T19:47:46.054000Z TestFramework (INFO): Step 8: Reconsider the block containing those txs
2025-07-07T19:47:46.058000Z TestFramework (INFO): Step 9: Broadcast a tx with mixed outputs
2025-07-07T19:48:46.071000Z TestFramework (INFO): Step 10: Mine another block
2025-07-07T19:48:46.085000Z TestFramework (INFO): Step 11: Avalanche rejects the block
2025-07-07T19:48:46.394000Z TestFramework (INFO): Step 12: Avalanche invalidates the block
2025-07-07T19:48:48.591000Z TestFramework (INFO): Step 13: Mine another block
2025-07-07T19:48:48.598000Z TestFramework (INFO): Got a next message but no more step, exiting
2025-07-07T19:48:48.649000Z TestFramework (INFO): Stopping nodes
2025-07-07T19:48:48.752000Z TestFramework (INFO): Cleaning up /work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_₿₵_🏃_20250707_194731_5732/setup_scripts/chronik-client_websocket_0 on exit
2025-07-07T19:48:48.752000Z TestFramework (INFO): Tests successful
Running Unit Tests for Test Framework Modules
setup_scripts/chronik-client_websocket.py started
setup_scripts/chronik-client_websocket.py passed, Duration: 77 s

TEST                                      | STATUS    | DURATION

setup_scripts/chronik-client_websocket.py | ✓ Passed  | 77 s

ALL                                       | ✓ Passed  | 77 s (accumulated) 
Runtime: 77 s

Test runner error for chronik-client_websocket, aborting: Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
----------------------|---------|----------|---------|---------|------------------------------------
File                  | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                  
----------------------|---------|----------|---------|---------|------------------------------------
All files             |    41.5 |    17.93 |   37.37 |    41.6 |                                    
 chronik-client       |     100 |      100 |     100 |     100 |                                    
  index.ts            |     100 |      100 |     100 |     100 |                                    
 chronik-client/proto |   31.46 |    12.95 |   21.54 |   31.73 |                                    
  chronik.ts          |   31.46 |    12.95 |   21.54 |   31.73 | ...8,6614-6617,6623-6665,6701-6710 
 chronik-client/src   |    84.6 |    73.71 |      83 |   84.69 |                                    
  ChronikClient.ts    |   84.36 |    75.39 |   86.32 |   84.96 | ...5,1487,1497,1522,1534,1540,1546 
  failoverProxy.ts    |   79.46 |    61.29 |   66.66 |   78.89 | ...282-285,288,301,308,312,316,325 
  hex.ts              |   89.47 |       50 |      75 |   87.87 | 58,66-68                           
  validation.ts       |   95.55 |     87.5 |     100 |      95 | 33,39                              
----------------------|---------|----------|---------|---------|------------------------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='1358']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='3272']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='383']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='2135']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='222']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='594']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='1345']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='3233']
##teamcity[blockClosed name='Code Coverage Summary']
Build chronik-client-integration-tests failed with exit code 255
hazzarust edited the summary of this revision. (Show Details)

Added back the yield and changed websocket.rs ordering.

Fabien requested changes to this revision.Jul 8 2025, 07:27
Fabien added inline comments.
modules/bitcoinsuite-chronik-client/tests/websocket.rs
278

Why did you remove this ?

306

And this ?

965

Still there are only 13 steps in the python file

This revision now requires changes to proceed.Jul 8 2025, 07:27

Updated wording on Python steps to make aligned

Fabien added inline comments.
modules/bitcoinsuite-chronik-client/tests/websocket.rs
331 ↗(On Diff #54777)

remove the unrelated change. This might look not important but this will mess up the git history for that line and make git blame more difficult to use

This revision is now accepted and ready to land.Jul 10 2025, 08:08