Page MenuHomePhabricator

[Chronik] Add failover.ts integration test to chronik-client
DraftPublic

Authored by hazzarust on Jun 11 2025, 14:26.
This is a draft revision that has not yet been submitted for review.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Summary

draft right now

Test Plan

cd modules/chronik-client/test/integration
npx mocha -j1 -r ts-node/register failover.ts

Event Timeline

Owners added a reviewer: Restricted Owners Package.Jun 11 2025, 14:26
hazzarust edited the test plan for this revision. (Show Details)

Tail of the build log:

Mocha timeout set to 240 seconds
2025-06-11T14:37:12.111000Z TestFramework (INFO): Step 1: Send an SLP NFT1 genesis tx
2025-06-11T14:37:12.116000Z TestFramework (INFO): Step 2: Mint a child token
2025-06-11T14:37:12.118000Z TestFramework (INFO): Step 3: Send a child token
2025-06-11T14:37:13.122000Z TestFramework (INFO): Step 4: NFT 1 child genesis
2025-06-11T14:37:13.132000Z TestFramework (INFO): Step 5: Mine a block
token_slp_nft1.ts tests complete, shutting down child process
2025-06-11T14:37:13.167000Z TestFramework (INFO): Got a next message but no more step, exiting
2025-06-11T14:37:13.218000Z TestFramework (INFO): Stopping nodes
2025-06-11T14:37:13.271000Z TestFramework (INFO): Cleaning up /work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_₿₵_🏃_20250611_143711_53177/setup_scripts/chronik-client_token_slp_nft1_0 on exit
2025-06-11T14:37:13.271000Z TestFramework (INFO): Tests successful
Running Unit Tests for Test Framework Modules
setup_scripts/chronik-client_token_slp_nft1.py started
setup_scripts/chronik-client_token_slp_nft1.py passed, Duration: 2 s

TEST                                           | STATUS    | DURATION

setup_scripts/chronik-client_token_slp_nft1.py | ✓ Passed  | 2 s

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

testRunner complete in token_slp_nft1.ts
Starting test_runner for chronik-client_websocket
Test runner for chronik-client_websocket started
2025-06-11T14:37:13.598000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_₿₵_🏃_20250611_143713_62029/setup_scripts/chronik-client_websocket_0
chronikUrl set to ["http://127.0.0.1:26000"]
Mocha timeout set to 240 seconds
2025-06-11T14:37:15.040000Z TestFramework (INFO): Passed test setup data to mocha
2025-06-11T14:37:22.352000Z TestFramework (INFO): Step 1: Avalanche finalize a block
2025-06-11T14:37:24.526000Z TestFramework (INFO): Step 2: Broadcast 1 tx to a p2pk, p2pkh, and p2sh address
2025-06-11T14:37:24.556000Z TestFramework (INFO): Step 3: Mine a block with these txs
2025-06-11T14:37:24.561000Z TestFramework (INFO): Step 4: Finalize the block containing these txs with Avalanche
2025-06-11T14:37:26.794000Z TestFramework (INFO): Step 5: Park the block containing those txs
2025-06-11T14:37:26.798000Z TestFramework (INFO): Step 8: Unpark the block containing those txs
2025-06-11T14:37:26.802000Z TestFramework (INFO): Step 9: Manually invalidate the block containing those txs
2025-06-11T14:37:26.806000Z TestFramework (INFO): Step 10: Reconsider the block containing those txs
2025-06-11T14:37:26.810000Z TestFramework (INFO): Step 11: Broadcast a tx with mixed outputs
2025-06-11T14:37:26.818000Z TestFramework (INFO): Step 12: Mine another block
2025-06-11T14:37:26.822000Z TestFramework (INFO): Step 13: Avalanche rejects the block
2025-06-11T14:37:27.114000Z TestFramework (INFO): Step 14: Avalanche invalidates the block
2025-06-11T14:37:29.203000Z TestFramework (INFO): Step 15: Mine another block
websocket.ts tests complete, shutting down child process
2025-06-11T14:37:29.207000Z TestFramework (INFO): Got a next message but no more step, exiting
2025-06-11T14:37:29.258000Z TestFramework (INFO): Stopping nodes
2025-06-11T14:37:29.359000Z TestFramework (INFO): Cleaning up /work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_₿₵_🏃_20250611_143713_62029/setup_scripts/chronik-client_websocket_0 on exit
2025-06-11T14:37:29.359000Z 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: 16 s

TEST                                      | STATUS    | DURATION

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

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

testRunner complete in websocket.ts
Build chronik-client-integration-tests timed out after 3600.0s

Tail of the build log:

  File "/work/test/functional/setup_scripts/../test_framework/util.py", line 310, in wait_until_helper
    raise AssertionError(
AssertionError: Predicate ''''
        def is_quorum_established():
            info = nodes_two.getavalancheinfo()
            self.log.info(f"Avalanche info: {info}")
            return info["ready_to_poll"] is True
''' not true after 60.0 seconds
2025-06-13T01:56:00.005000Z TestFramework (INFO): Stopping nodes
2025-06-13T01:56:00.110000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_₿₵_🏃_20250613_015443_63345/setup_scripts/chronik-client_failover_0
2025-06-13T01:56:00.110000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_₿₵_🏃_20250613_015443_63345/setup_scripts/chronik-client_failover_0/test_framework.log
2025-06-13T01:56:00.110000Z TestFramework (ERROR): 
2025-06-13T01:56:00.111000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_₿₵_🏃_20250613_015443_63345/setup_scripts/chronik-client_failover_0' to consolidate all logs
2025-06-13T01:56:00.111000Z TestFramework (ERROR): 
2025-06-13T01:56:00.111000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2025-06-13T01:56:00.111000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2025-06-13T01:56:00.111000Z TestFramework (ERROR): 
Running Unit Tests for Test Framework Modules
setup_scripts/chronik-client_failover.py started
setup_scripts/chronik-client_failover.py failed, Duration: 76 s

stdout:

stderr:


TEST                                     | STATUS    | DURATION

setup_scripts/chronik-client_failover.py | ✖ Failed  | 76 s

ALL                                      | ✖ Failed  | 76 s (accumulated) 
Runtime: 76 s

Test runner for chronik-client_failover completed with code 1
----------------------|---------|----------|---------|---------|------------------------------------
File                  | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                  
----------------------|---------|----------|---------|---------|------------------------------------
All files             |   27.13 |    10.75 |   23.58 |   27.07 |                                    
 chronik-client       |     100 |      100 |     100 |     100 |                                    
  index.ts            |     100 |      100 |     100 |     100 |                                    
 chronik-client/proto |   20.78 |     8.07 |   14.74 |   20.97 |                                    
  chronik.ts          |   20.78 |     8.07 |   14.74 |   20.97 | ...4,6520-6523,6529-6571,6607-6616 
 chronik-client/src   |   54.86 |    41.17 |   49.65 |   54.21 |                                    
  ChronikClient.ts    |   43.73 |    35.24 |   44.24 |   44.05 | ...2,1424,1436,1446,1471,1483-1548 
  failoverProxy.ts    |    80.9 |    61.29 |   73.07 |   80.37 | ...272-273,282-285,288,308,312,321 
  hex.ts              |   89.47 |       50 |      75 |   87.87 | 58,66-68                           
  validation.ts       |   63.41 |    46.66 |      25 |   59.45 | 33,39,54-55,62-63,73-88            
----------------------|---------|----------|---------|---------|------------------------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='872']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='3214']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='226']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='2102']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='137']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='581']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='860']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='3176']
##teamcity[blockClosed name='Code Coverage Summary']
Build chronik-client-integration-tests failed with exit code 1

Tail of the build log:

  File "/work/test/functional/setup_scripts/../test_framework/util.py", line 310, in wait_until_helper
    raise AssertionError(
AssertionError: Predicate ''''
        def is_quorum_established():
            info = nodes_two.getavalancheinfo()
            self.log.info(f"Avalanche info: {info}")
            return info["ready_to_poll"] is True
''' not true after 60.0 seconds
2025-06-13T02:04:03.546000Z TestFramework (INFO): Stopping nodes
2025-06-13T02:04:03.650000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_₿₵_🏃_20250613_020246_22216/setup_scripts/chronik-client_failover_0
2025-06-13T02:04:03.650000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_₿₵_🏃_20250613_020246_22216/setup_scripts/chronik-client_failover_0/test_framework.log
2025-06-13T02:04:03.650000Z TestFramework (ERROR): 
2025-06-13T02:04:03.650000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_₿₵_🏃_20250613_020246_22216/setup_scripts/chronik-client_failover_0' to consolidate all logs
2025-06-13T02:04:03.651000Z TestFramework (ERROR): 
2025-06-13T02:04:03.651000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2025-06-13T02:04:03.651000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2025-06-13T02:04:03.651000Z TestFramework (ERROR): 
Running Unit Tests for Test Framework Modules
setup_scripts/chronik-client_failover.py started
setup_scripts/chronik-client_failover.py failed, Duration: 77 s

stdout:

stderr:


TEST                                     | STATUS    | DURATION

setup_scripts/chronik-client_failover.py | ✖ Failed  | 77 s

ALL                                      | ✖ Failed  | 77 s (accumulated) 
Runtime: 77 s

Test runner for chronik-client_failover completed with code 1
----------------------|---------|----------|---------|---------|------------------------------------
File                  | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                  
----------------------|---------|----------|---------|---------|------------------------------------
All files             |   27.13 |    10.75 |   23.58 |   27.07 |                                    
 chronik-client       |     100 |      100 |     100 |     100 |                                    
  index.ts            |     100 |      100 |     100 |     100 |                                    
 chronik-client/proto |   20.78 |     8.07 |   14.74 |   20.97 |                                    
  chronik.ts          |   20.78 |     8.07 |   14.74 |   20.97 | ...4,6520-6523,6529-6571,6607-6616 
 chronik-client/src   |   54.86 |    41.17 |   49.65 |   54.21 |                                    
  ChronikClient.ts    |   43.73 |    35.24 |   44.24 |   44.05 | ...2,1424,1436,1446,1471,1483-1548 
  failoverProxy.ts    |    80.9 |    61.29 |   73.07 |   80.37 | ...272-273,282-285,288,308,312,321 
  hex.ts              |   89.47 |       50 |      75 |   87.87 | 58,66-68                           
  validation.ts       |   63.41 |    46.66 |      25 |   59.45 | 33,39,54-55,62-63,73-88            
----------------------|---------|----------|---------|---------|------------------------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='872']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='3214']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='226']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='2102']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='137']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='581']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='860']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='3176']
##teamcity[blockClosed name='Code Coverage Summary']
Build chronik-client-integration-tests failed with exit code 1

Tail of the build log:

  File "/work/test/functional/setup_scripts/../test_framework/test_framework.py", line 890, in wait_until
    return wait_until_helper(
           ^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/setup_scripts/../test_framework/util.py", line 310, in wait_until_helper
    raise AssertionError(
AssertionError: Predicate ''''
        self.wait_until(lambda: is_rejected_block(next_blockhash))
''' not true after 60.0 seconds
2025-06-13T09:57:57.085000Z TestFramework (INFO): Stopping nodes
2025-06-13T09:57:57.138000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_₿₵_🏃_20250613_095642_63912/setup_scripts/chronik-client_failover_0
2025-06-13T09:57:57.138000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_₿₵_🏃_20250613_095642_63912/setup_scripts/chronik-client_failover_0/test_framework.log
2025-06-13T09:57:57.138000Z TestFramework (ERROR): 
2025-06-13T09:57:57.138000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_₿₵_🏃_20250613_095642_63912/setup_scripts/chronik-client_failover_0' to consolidate all logs
2025-06-13T09:57:57.138000Z TestFramework (ERROR): 
2025-06-13T09:57:57.138000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2025-06-13T09:57:57.138000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2025-06-13T09:57:57.138000Z TestFramework (ERROR): 
Running Unit Tests for Test Framework Modules
setup_scripts/chronik-client_failover.py started
setup_scripts/chronik-client_failover.py failed, Duration: 75 s

stdout:

stderr:


TEST                                     | STATUS    | DURATION

setup_scripts/chronik-client_failover.py | ✖ Failed  | 75 s

ALL                                      | ✖ Failed  | 75 s (accumulated) 
Runtime: 75 s

Test runner for chronik-client_failover completed with code 1
----------------------|---------|----------|---------|---------|------------------------------------
File                  | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                  
----------------------|---------|----------|---------|---------|------------------------------------
All files             |   27.13 |    10.75 |   23.58 |   27.07 |                                    
 chronik-client       |     100 |      100 |     100 |     100 |                                    
  index.ts            |     100 |      100 |     100 |     100 |                                    
 chronik-client/proto |   20.78 |     8.07 |   14.74 |   20.97 |                                    
  chronik.ts          |   20.78 |     8.07 |   14.74 |   20.97 | ...4,6520-6523,6529-6571,6607-6616 
 chronik-client/src   |   54.86 |    41.17 |   49.65 |   54.21 |                                    
  ChronikClient.ts    |   43.73 |    35.24 |   44.24 |   44.05 | ...2,1424,1436,1446,1471,1483-1548 
  failoverProxy.ts    |    80.9 |    61.29 |   73.07 |   80.37 | ...272-273,282-285,288,308,312,321 
  hex.ts              |   89.47 |       50 |      75 |   87.87 | 58,66-68                           
  validation.ts       |   63.41 |    46.66 |      25 |   59.45 | 33,39,54-55,62-63,73-88            
----------------------|---------|----------|---------|---------|------------------------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='872']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='3214']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='226']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='2102']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='137']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='581']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='860']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='3176']
##teamcity[blockClosed name='Code Coverage Summary']
Build chronik-client-integration-tests failed with exit code 1

Why is next_blockhash coming as undefined?

Tail of the build log:

Mocha timeout set to 240 seconds
2025-06-13T11:59:50.275000Z TestFramework (INFO): Step 1: Send an SLP NFT1 genesis tx
2025-06-13T11:59:50.279000Z TestFramework (INFO): Step 2: Mint a child token
2025-06-13T11:59:50.281000Z TestFramework (INFO): Step 3: Send a child token
2025-06-13T11:59:51.288000Z TestFramework (INFO): Step 4: NFT 1 child genesis
2025-06-13T11:59:51.299000Z TestFramework (INFO): Step 5: Mine a block
token_slp_nft1.ts tests complete, shutting down child process
2025-06-13T11:59:51.336000Z TestFramework (INFO): Got a next message but no more step, exiting
2025-06-13T11:59:51.387000Z TestFramework (INFO): Stopping nodes
2025-06-13T11:59:51.491000Z TestFramework (INFO): Cleaning up /work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_₿₵_🏃_20250613_115949_18402/setup_scripts/chronik-client_token_slp_nft1_0 on exit
2025-06-13T11:59:51.491000Z TestFramework (INFO): Tests successful
Running Unit Tests for Test Framework Modules
setup_scripts/chronik-client_token_slp_nft1.py started
setup_scripts/chronik-client_token_slp_nft1.py passed, Duration: 2 s

TEST                                           | STATUS    | DURATION

setup_scripts/chronik-client_token_slp_nft1.py | ✓ Passed  | 2 s

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

testRunner complete in token_slp_nft1.ts
Starting test_runner for chronik-client_websocket
Test runner for chronik-client_websocket started
2025-06-13T11:59:51.799000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_₿₵_🏃_20250613_115951_54477/setup_scripts/chronik-client_websocket_0
chronikUrl set to ["http://127.0.0.1:26000"]
Mocha timeout set to 240 seconds
2025-06-13T11:59:52.949000Z TestFramework (INFO): Passed test setup data to mocha
2025-06-13T12:00:00.457000Z TestFramework (INFO): Step 1: Avalanche finalize a block
2025-06-13T12:00:02.934000Z TestFramework (INFO): Step 2: Broadcast 1 tx to a p2pk, p2pkh, and p2sh address
2025-06-13T12:00:02.980000Z TestFramework (INFO): Step 3: Mine a block with these txs
2025-06-13T12:00:02.984000Z TestFramework (INFO): Step 4: Finalize the block containing these txs with Avalanche
2025-06-13T12:00:05.477000Z TestFramework (INFO): Step 5: Park the block containing those txs
2025-06-13T12:00:05.481000Z TestFramework (INFO): Step 8: Unpark the block containing those txs
2025-06-13T12:00:05.485000Z TestFramework (INFO): Step 9: Manually invalidate the block containing those txs
2025-06-13T12:00:05.488000Z TestFramework (INFO): Step 10: Reconsider the block containing those txs
2025-06-13T12:00:05.492000Z TestFramework (INFO): Step 11: Broadcast a tx with mixed outputs
2025-06-13T12:00:05.500000Z TestFramework (INFO): Step 12: Mine another block
2025-06-13T12:00:05.505000Z TestFramework (INFO): Step 13: Avalanche rejects the block
2025-06-13T12:00:05.810000Z TestFramework (INFO): Step 14: Avalanche invalidates the block
2025-06-13T12:00:07.950000Z TestFramework (INFO): Step 15: Mine another block
websocket.ts tests complete, shutting down child process
2025-06-13T12:00:07.955000Z TestFramework (INFO): Got a next message but no more step, exiting
2025-06-13T12:00:08.006000Z TestFramework (INFO): Stopping nodes
2025-06-13T12:00:08.107000Z TestFramework (INFO): Cleaning up /work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_₿₵_🏃_20250613_115951_54477/setup_scripts/chronik-client_websocket_0 on exit
2025-06-13T12:00:08.107000Z 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: 16 s

TEST                                      | STATUS    | DURATION

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

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

testRunner complete in websocket.ts
Build chronik-client-integration-tests timed out after 3600.0s