Page MenuHomePhabricator

[Chronik] Add unix socket listener to test_runner.rs
Needs ReviewPublic

Authored by hazzarust on Sun, Jan 19, 22:40.

Details

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

Depends on D17564

A Unix socket is used for communication between the parent (Rust) and child (Python) processes. In future iterations, the socket stream will be passed to a handler. The Unix socket is only checked in ipc.py if it's passed as an environment variable to the child process. Therefore, this change does not affect the current TypeScript Chronik tests.

Test Plan

cd modules/bitcoinsuite-chronik-client && cargo test -- --nocapture

Event Timeline

Owners added a reviewer: Restricted Owners Package.Sun, Jan 19, 22:40
Fabien added a subscriber: Fabien.

Don't use quotes for "Depends on xxxxx" (I edited your summary to remove them)

Fabien requested changes to this revision.Mon, Jan 20, 09:05

Please fix the typos in the summary, and fix the test plan which doesn't work.
To format commands you can either use backticks (example) or on a newline prepend with two spaces:

like so

More info: https://secure.phabricator.com/book/phabricator/article/remarkup/

This revision now requires changes to proceed.Mon, Jan 20, 09:05

So look at the code:

  • The second test is doing the same as the first plus some more. This makes it clear that you don't need both because they are overlapping
  • As a result you don't need serial. To be honest I don't know why you needed it in the first place, but after it's obvious that it's no longer needed.
  • Because you only need a single test, you can build on top of the one from the dependency diff D17564, which will avoid me requesting the same changes again.
modules/bitcoinsuite-chronik-client/Cargo.toml
34

It should be in the dev dependencies

modules/bitcoinsuite-chronik-client/src/test_runner.rs
46

You want the message to print the socket path also (and actually mostly) if it fails

test/functional/setup_scripts/ipc.py
70

No reason to do this really, it just creates unrelated changes.

hazzarust edited the summary of this revision. (Show Details)

Deleted second test, made socket error handling verbose