tests: Make opt-starttls more robust
Grepping for a specific nbdkit 1.33.1 error message when provoking a
bug that caused the server to lose sync is risky; on my development
machine, I normally hit:
nbdkit: null[1]: error: unknown option version 30003, expecting 49484156454f5054
but in our CI on ppc64le, it looks like we hit a race where we instead
exited nbdinfo early enough that nbdkit may have printed a different
message:
nbdkit: null[1]: error: reading option: conn->recv: Bad message
or been killed before printing anything; either way, since that didn't
match what grep was looking for, the test ran (and failed) instead of
skipping as intended. Instead of trying to use a one-liner
require("..."), just open-code a more specific trigger of the nbdkit
bug that will reliably force us to wait for the server to process
unflushed data and move us to a DEAD state, getting rid of the
stochastic multi-process race.
While at it, we only need to check that libnbd supports TLS once,
instead of 3 times.
Thanks: Richard W.M. Jones
Please register or sign in to comment