autest: skip tls_engine_abort test when plugin is absent - #13494
Conversation
Same gap caf9c87 fixed in tls_async_handshake.test.py: SkipUnless only registers conditions for later, it doesn't stop the script from running, so PrepareTestPlugin still ran at load time and raised a ValueError on non-OpenSSL builds where async_handshake.so is never built. tls_engine_abort.test.py was added afterward from the same template but didn't carry the guard over. Guard the call on file existence so it skips cleanly.
There was a problem hiding this comment.
Pull request overview
This PR fixes an AuTest execution-time failure in tls_engine_abort.test.py when the async_handshake.so test plugin is not built (e.g., non-OpenSSL builds such as BoringSSL). It ensures the test script does not raise at import/load time and instead allows the framework to skip the test cleanly.
Changes:
- Guard
Test.PrepareTestPlugin(async_handshake, ...)behindos.path.isfile(async_handshake)so it is only executed when the plugin exists.
cmcfarlen
left a comment
There was a problem hiding this comment.
LGTM. Same gap and same fix as #13372 (caf9c87), which applied the identical if os.path.isfile(async_handshake): guard to tls_async_handshake.test.py; this file was derived from that one before the guard landed.
The reasoning about Test.SkipUnless is right: it only registers conditions the framework evaluates later, so the Condition(lambda: os.path.isfile(async_handshake), ...) already in the file does nothing to stop PrepareTestPlugin from running at load time and raising ValueError. Guarding the call keeps the existing skip condition as the thing that actually reports the skip.
Same gap caf9c87 fixed in tls_async_handshake.test.py: SkipUnless only registers conditions for later, it doesn't stop the script from running, so PrepareTestPlugin still ran at load time and raised a ValueError on non-OpenSSL builds where async_handshake.so is never built. tls_engine_abort.test.py was added afterward from the same template but didn't carry the guard over. Guard the call on file existence so it skips cleanly. (cherry picked from commit f00122e)
|
Cherry-picked to the 10.2.x branch as 6fb80a1 for the 10.2.0 release. |
Description
tls_engine_abort.test.pycallsTest.PrepareTestPlugin(async_handshake, ts, '-delay-ms=2000')unconditionally. On non-OpenSSL builds (e.g. BoringSSL)
async_handshake.soisnever built, so this raises
ValueError: PrepareTestPlugin: file does not exist: ...and the test errors out instead of skipping cleanly.Test.SkipUnless(...)only registers skip conditions for the framework tocheck later — it does not halt execution of the rest of the test script. So
even though the file already guards on:
the
Test.PrepareTestPlugin(...)call still runs at load time regardless.This is the same gap #13372 fixed in
tls_async_handshake.test.py.tls_engine_abort.test.pywas added afterward from that file as a templatebut didn't carry the guard over. This PR applies the same fix: guard the call
on file existence so the test skips cleanly on non-OpenSSL builds.
Test plan
of erroring.