Page MenuHomePhabricator

[chronik-client] Make sure we have a listener attached when emitting the ready status event
ClosedPublic

Authored by Fabien on May 2 2024, 10:19.

Details

Summary

Otherwise wait for a bit and retry in a loop. Mocha will eventually time out if no listener is ever attached. Also do the same for ecash-lib.

This will fix most of the integration test failures.

Test Plan
npm run integration-tests

Event Timeline

Fabien requested review of this revision.May 2 2024, 10:19

Tail of the build log:

  File "/work/test/functional/setup_scripts/../test_framework/util.py", line 297, in wait_until_helper
    raise AssertionError(
AssertionError: Predicate ''''
            self.wait_until(lambda: is_finalblock(next_blockhash))
''' not true after 60.0 seconds
2024-05-02T10:31:23.677000Z TestFramework (INFO): Stopping nodes
2024-05-02T10:31:24.331000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_₿₵_🏃_20240502_103010/setup_scripts/chronik-client_websocket_0
2024-05-02T10:31:24.332000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_₿₵_🏃_20240502_103010/setup_scripts/chronik-client_websocket_0/test_framework.log
2024-05-02T10:31:24.332000Z TestFramework (ERROR): 
2024-05-02T10:31:24.332000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_₿₵_🏃_20240502_103010/setup_scripts/chronik-client_websocket_0' to consolidate all logs
2024-05-02T10:31:24.333000Z TestFramework (ERROR): 
2024-05-02T10:31:24.333000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2024-05-02T10:31:24.333000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2024-05-02T10:31:24.333000Z TestFramework (ERROR): 
Running Unit Tests for Test Framework Modules
setup_scripts/chronik-client_websocket.py started
setup_scripts/chronik-client_websocket.py failed, Duration: 73 s

stdout:

stderr:


TEST                                      | STATUS    | DURATION

setup_scripts/chronik-client_websocket.py | ✖ Failed  | 73 s

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

Test runner for chronik-client_websocket completed with code 1
-----------------------|---------|----------|---------|---------|-----------------------------------
File                   | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                 
-----------------------|---------|----------|---------|---------|-----------------------------------
All files              |   27.47 |    10.47 |   23.06 |   27.49 |                                   
 chronik-client        |     100 |      100 |     100 |     100 |                                   
  index.ts             |     100 |      100 |     100 |     100 |                                   
 chronik-client/proto  |   21.54 |     7.98 |   13.72 |   21.69 |                                   
  chronik.ts           |     6.1 |        1 |    2.54 |    6.09 | ...,3978-3985,3990-4027,4031-4036 
  chronikNode.ts       |   33.15 |    13.34 |   23.49 |    33.4 | ...,4882-4921,4929-5002,5037-5042 
 chronik-client/src    |    63.1 |    42.72 |   60.54 |   62.74 |                                   
  ChronikClient.ts     |    4.24 |        0 |       0 |    4.29 | 33-163,178-222,290-692            
  ChronikClientNode.ts |   90.07 |    70.89 |   95.71 |   90.07 | ...52,876,888,898,923,935,941,947 
  failoverProxy.ts     |   76.19 |    59.09 |   66.66 |   75.49 | ...61-264,267,275-285,294,303,307 
  hex.ts               |   89.47 |       75 |      75 |   87.87 | 58,66-68                          
  validation.ts        |      90 |    84.61 |     100 |   89.47 | 31,37                             
-----------------------|---------|----------|---------|---------|-----------------------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='1125']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='4095']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='463']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='4422']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='170']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='737']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='1115']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='4056']
##teamcity[blockClosed name='Code Coverage Summary']
mv: cannot stat 'test_results/chronik-client-integration-tests-junit.xml': No such file or directory
Build chronik-client-integration-tests failed with exit code 1

This is an unrelated issue that needs to be solved in another diff.

This revision is now accepted and ready to land.May 2 2024, 16:32
This revision was landed with ongoing or failed builds.May 2 2024, 20:00
This revision was automatically updated to reflect the committed changes.