Skip to content

Conversation

@stickies-v
Copy link
Contributor

@stickies-v stickies-v commented Nov 27, 2025

When the handler fails, the feedback is currently quite sparse with just "handler closed unexpectedly". Since it may be hard to connect a debugger to the handler process, would be helpful to just dump the stderror output.

For example, all my tests suddenly started failing, and I couldn't reproduce it locally by manually invoking the handler. The current output (narrowed down to just a single test) was:

=== Running test suite: script_verify_success.json ===

Test Suite: Script Verification - Success Cases
Description: Test cases for script verification that should succeed
Total: 1, Passed: 0, Failed: 1

  ✗ valid_p2pkh_legacy (Valid legacy P2PKH (Pay-to-PubKey-Hash) transaction verification)
      Failed to send request: handler closed unexpectedly

With this PR, it would be obvious to see that I just forgot to activate my venv:

=== Running test suite: script_verify_success.json ===

Test Suite: Script Verification - Success Cases
Description: Test cases for script verification that should succeed
Total: 1, Passed: 0, Failed: 1

  ✗ valid_p2pkh_legacy (Valid legacy P2PKH (Pay-to-PubKey-Hash) transaction verification)
      Failed to send request: handler closed unexpectedly: Traceback (most recent call last):
  File "./conformance/handler.py", line 17, in <module>
    import pbk
ModuleNotFoundError: No module named 'pbk'

I'm not a Go dev, so if there are more idiomatic ways of achieving this, please feel free to close / fix as necessary.

Returning stderr helps the user debug why the closure may have
happened.
@yuvicc
Copy link

yuvicc commented Nov 28, 2025

Huge Concept ACKKK, I was having a hard time to address this. But I think its a nice thing to have in kernel bindings tests in my view.

@janb84
Copy link
Contributor

janb84 commented Nov 28, 2025

Yes Concept ACK. Something like this would be nice to have.

@stringintech
Copy link
Owner

Nice! Thanks for noticing this @stickies-v!
Pushed a commit to address a rare scenario where stdout closes but stderr remains open.
There is also a related issue here that we keep running the remaining test cases of a test suite with the broken handler which I will address in a follow up.

@stringintech stringintech merged commit 3b7e4de into stringintech:main Nov 28, 2025
1 check passed
@stickies-v stickies-v deleted the handler-err branch November 28, 2025 15:56
@stringintech
Copy link
Owner

we keep running the remaining test cases of a test suite with the broken handler which I will address in a follow up

Fixed in #9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants