Page MenuHomePhabricator

[chronik] Add failover_proxy to bitcoinsuite-chronik-client
DraftPublic

Authored by hazzarust on Wed, Mar 26, 20: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
Test Plan

TBD

Event Timeline

Owners added a reviewer: Restricted Owners Package.Wed, Mar 26, 20:26

Tail of the build log:

warning: unused variable: `client`
   --> modules/bitcoinsuite-chronik-client/src/failover_proxy.rs:138:9
    |
138 |         client: &Client,
    |         ^^^^^^ help: if this is intentional, prefix it with an underscore: `_client`

warning: unused variable: `url`
   --> modules/bitcoinsuite-chronik-client/src/failover_proxy.rs:139:9
    |
139 |         url: &str,
    |         ^^^ help: if this is intentional, prefix it with an underscore: `_url`

warning: unused variable: `path`
   --> modules/bitcoinsuite-chronik-client/src/failover_proxy.rs:140:9
    |
140 |         path: &str,
    |         ^^^^ help: if this is intentional, prefix it with an underscore: `_path`

warning: unused variable: `method`
   --> modules/bitcoinsuite-chronik-client/src/failover_proxy.rs:141:9
    |
141 |         method: Method,
    |         ^^^^^^ help: if this is intentional, prefix it with an underscore: `_method`

warning: unused variable: `data`
   --> modules/bitcoinsuite-chronik-client/src/failover_proxy.rs:142:9
    |
142 |         data: Option<Bytes>,
    |         ^^^^ help: if this is intentional, prefix it with an underscore: `_data`

warning: unused variable: `response`
   --> modules/bitcoinsuite-chronik-client/src/failover_proxy.rs:151:9
    |
151 |         response: Response,
    |         ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_response`

warning: unused variable: `path`
   --> modules/bitcoinsuite-chronik-client/src/failover_proxy.rs:152:9
    |
152 |         path: &str,
    |         ^^^^ help: if this is intentional, prefix it with an underscore: `_path`

warning: unused variable: `ws_url`
   --> modules/bitcoinsuite-chronik-client/src/failover_proxy.rs:161:9
    |
161 |         ws_url: &str,
    |         ^^^^^^ help: if this is intentional, prefix it with an underscore: `_ws_url`

warning: unused variable: `ws_endpoint`
   --> modules/bitcoinsuite-chronik-client/src/failover_proxy.rs:170:9
    |
170 |         ws_endpoint: &mut WebSocketStream<tokio::net::TcpStream>,
    |         ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_ws_endpoint`

For more information about this error, try `rustc --explain E0432`.
warning: `bitcoinsuite-chronik-client` (lib) generated 16 warnings
error: could not compile `bitcoinsuite-chronik-client` (lib) due to 1 previous error; 16 warnings emitted
warning: build failed, waiting for other jobs to finish...
Build build-explorer failed with exit code 101

Tail of the build log:

warning: unused variable: `client`
   --> modules/bitcoinsuite-chronik-client/src/failover_proxy.rs:138:9
    |
138 |         client: &Client,
    |         ^^^^^^ help: if this is intentional, prefix it with an underscore: `_client`

warning: unused variable: `url`
   --> modules/bitcoinsuite-chronik-client/src/failover_proxy.rs:139:9
    |
139 |         url: &str,
    |         ^^^ help: if this is intentional, prefix it with an underscore: `_url`

warning: unused variable: `path`
   --> modules/bitcoinsuite-chronik-client/src/failover_proxy.rs:140:9
    |
140 |         path: &str,
    |         ^^^^ help: if this is intentional, prefix it with an underscore: `_path`

warning: unused variable: `method`
   --> modules/bitcoinsuite-chronik-client/src/failover_proxy.rs:141:9
    |
141 |         method: Method,
    |         ^^^^^^ help: if this is intentional, prefix it with an underscore: `_method`

warning: unused variable: `data`
   --> modules/bitcoinsuite-chronik-client/src/failover_proxy.rs:142:9
    |
142 |         data: Option<Bytes>,
    |         ^^^^ help: if this is intentional, prefix it with an underscore: `_data`

warning: unused variable: `response`
   --> modules/bitcoinsuite-chronik-client/src/failover_proxy.rs:151:9
    |
151 |         response: Response,
    |         ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_response`

warning: unused variable: `path`
   --> modules/bitcoinsuite-chronik-client/src/failover_proxy.rs:152:9
    |
152 |         path: &str,
    |         ^^^^ help: if this is intentional, prefix it with an underscore: `_path`

warning: unused variable: `ws_url`
   --> modules/bitcoinsuite-chronik-client/src/failover_proxy.rs:161:9
    |
161 |         ws_url: &str,
    |         ^^^^^^ help: if this is intentional, prefix it with an underscore: `_ws_url`

warning: unused variable: `ws_endpoint`
   --> modules/bitcoinsuite-chronik-client/src/failover_proxy.rs:170:9
    |
170 |         ws_endpoint: &mut WebSocketStream<tokio::net::TcpStream>,
    |         ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_ws_endpoint`

For more information about this error, try `rustc --explain E0432`.
warning: `bitcoinsuite-chronik-client` (lib) generated 16 warnings
error: could not compile `bitcoinsuite-chronik-client` (lib) due to 1 previous error; 16 warnings emitted
warning: build failed, waiting for other jobs to finish...
Build build-bitcoinsuite-chronik-client failed with exit code 101

Tail of the build log:

   |       ^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: methods `call_request`, `ensure_response_error_thrown`, and `websocket_url_connects` are never used
   --> modules/bitcoinsuite-chronik-client/src/failover_proxy.rs:120:14
    |
25  | impl FailoverProxy {
    | ------------------ methods in this implementation
...
120 |     async fn call_request(
    |              ^^^^^^^^^^^^
...
132 |     async fn ensure_response_error_thrown(
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
141 |     async fn websocket_url_connects(
    |              ^^^^^^^^^^^^^^^^^^^^^^

warning: `bitcoinsuite-chronik-client` (lib) generated 14 warnings (run `cargo fix --lib -p bitcoinsuite-chronik-client` to apply 12 suggestions)
   Compiling pretty_assertions v1.4.1
   Compiling bitcoinsuite-chronik-client v0.1.0 (/work/modules/bitcoinsuite-chronik-client)
warning: unused import: `super::*`
   --> modules/bitcoinsuite-chronik-client/src/failover_proxy.rs:160:9
    |
160 |     use super::*;
    |         ^^^^^^^^
    |
    = note: `#[warn(unused_imports)]` on by default

warning: `bitcoinsuite-chronik-client` (lib test) generated 15 warnings (14 duplicates) (run `cargo fix --lib -p bitcoinsuite-chronik-client --tests` to apply 1 suggestion)
    Finished test [unoptimized + debuginfo] target(s) in 4.29s
     Running unittests src/lib.rs (/work/target/debug/deps/bitcoinsuite_chronik_client-37e2da86cb73aea0)

running 4 tests
test failover_proxy::tests::test_append_ws_urls ... FAILED
test failover_proxy::tests::test_derive_endpoint_index ... FAILED
test tests::test_constructor_trailing_slash ... ok
test tests::test_constructor_invalid_schema ... ok

failures:

---- failover_proxy::tests::test_append_ws_urls stdout ----
thread 'failover_proxy::tests::test_append_ws_urls' panicked at modules/bitcoinsuite-chronik-client/src/failover_proxy.rs:165:9:
not implemented
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- failover_proxy::tests::test_derive_endpoint_index stdout ----
thread 'failover_proxy::tests::test_derive_endpoint_index' panicked at modules/bitcoinsuite-chronik-client/src/failover_proxy.rs:171:9:
not implemented


failures:
    failover_proxy::tests::test_append_ws_urls
    failover_proxy::tests::test_derive_endpoint_index

test result: FAILED. 2 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

error: test failed, to rerun pass `-p bitcoinsuite-chronik-client --lib`
Build build-bitcoinsuite-chronik-client failed with exit code 101

Tail of the build log:

      data: "abc"
    }
  }
}
time_first_seen: 1743203322
size: 178
])
2025-03-28T23:08:43.056000Z TestFramework (INFO): Stopping nodes
2025-03-28T23:08:43.158000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_₿₵_🏃_20250328_230841/setup_scripts/chronik-client_plugins_0
2025-03-28T23:08:43.158000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_₿₵_🏃_20250328_230841/setup_scripts/chronik-client_plugins_0/test_framework.log
2025-03-28T23:08:43.158000Z TestFramework (ERROR): 
2025-03-28T23:08:43.159000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/chronik-client-integration-tests/test/tmp/test_runner_₿₵_🏃_20250328_230841/setup_scripts/chronik-client_plugins_0' to consolidate all logs
2025-03-28T23:08:43.159000Z TestFramework (ERROR): 
2025-03-28T23:08:43.159000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2025-03-28T23:08:43.159000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2025-03-28T23:08:43.159000Z TestFramework (ERROR): 
Running Unit Tests for Test Framework Modules
setup_scripts/chronik-client_plugins.py started
setup_scripts/chronik-client_plugins.py failed, Duration: 2 s

stdout:

stderr:


TEST                                    | STATUS    | DURATION

setup_scripts/chronik-client_plugins.py | ✖ Failed  | 2 s

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

Test runner for chronik-client_plugins completed with code 1
----------------------|---------|----------|---------|---------|------------------------------------
File                  | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                  
----------------------|---------|----------|---------|---------|------------------------------------
All files             |   31.16 |    12.31 |   28.39 |   31.13 |                                    
 chronik-client       |     100 |      100 |     100 |     100 |                                    
  index.ts            |     100 |      100 |     100 |     100 |                                    
 chronik-client/proto |   23.53 |     9.16 |   17.05 |   23.74 |                                    
  chronik.ts          |   23.53 |     9.16 |   17.05 |   23.74 | ...4,6520-6523,6529-6571,6607-6616 
 chronik-client/src   |   67.21 |    49.69 |   65.41 |   66.48 |                                    
  ChronikClient.ts    |   60.38 |    48.69 |   63.63 |   60.38 | ...6,1357-1365,1373-1438,1446-1451 
  failoverProxy.ts    |   79.43 |    58.06 |   69.23 |   78.84 | ...286-289,292,301,308,312,317,321 
  hex.ts              |   89.47 |       50 |      75 |   87.87 | 58,66-68                           
  validation.ts       |    75.6 |       40 |      75 |   72.97 | 17,21,33,38-49,62-63               
----------------------|---------|----------|---------|---------|------------------------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='988']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='3170']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='258']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='2095']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='161']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='567']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='976']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='3135']
##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