Tezt: let transfer terminate in transfer_and_wait_for_injection
Context
Related to #1529
The Tezt test Alpha: Test monitor_operations RPC occasionally leaves
processes hanging, which are eventually terminated by tezt. However,
when run under bisect instrumentation, this termination occasionally
corrupts the written coverage data.
Manually testing the MR
This error can be reproduced by running the following script reproduce-bisect-error.sh:
#!/bin/sh
set -e
make coverage-clean
BISECT_FILE=$(pwd)/_coverage_output/ dune exec tezt/tests/main.exe -- $@ -t "Alpha: Test monitor_operations RPC"
make coverage-report-summary
To run it, first make octez with instrumentation and then loop the script:
COVERAGE_OPTIONS="--instrument-with bisect_ppx" BISECT_FILE=$(pwd)/_coverage_output/ make
while ./reproduce-bisect-error.sh; do done
within short, you should see:
[12:51:50.985] [SUCCESS] (1/1) Alpha: Test monitor_operations RPC
bisect-ppx-report: internal error, uncaught exception:
Bisect_common.Invalid_file("_coverage_output/173366172.coverage", "unexpected end of file while reading magic number")
make: *** [Makefile:112: coverage-report-summary] Error 125
this MR fixes the issue by updating transfer_and_wait_for_injection
so that:
- the call to client initiating a transfer does not wait for confirmation
- it waits for the call to the client to terminate
- and then it waits for the injection
After which, running:
while ./reproduce-bisect-error.sh; do done
no longer reports any errors.
I'm not sure about the lwt/tezt event stuff in this MR. Wait happens
if the injection has already happened when the wait_for promise is
scheduled?
Checklist
- n/a Document the interface of any function added or modified (see the coding guidelines)
- n/a Document any change to the user interface, including configuration parameters (see node configuration)
- n/a Provide automatic testing (see the testing guide).
- n/a For new features and bug fixes, add an item in the appropriate changelog (
docs/protocols/alpha.rstfor the protocol and the environment, theDevelopment Versionsection ofCHANGES.mdfor everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR
Edited by Arvid Jakobsson