test: abort a test whose kit has a segfault by default.

Otherwise forkit tends to loop aggressively re-starting that for the
duration of the test wastefully.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ia1c684a5d995f54f29290c9631b1ee14266445d7
pull/8880/head
Michael Meeks 2024-04-27 10:35:35 +01:00 committed by Miklos Vajna
parent 642da39dc5
commit a866719881
3 changed files with 7 additions and 0 deletions

View File

@ -409,6 +409,10 @@ public:
/// When a new child kit process reports
virtual void newChild(const std::shared_ptr<ChildProcess>& /*child*/) {}
/// When we get a segfault message from forkit; override to test crashes ...
virtual void kitSegfault(int /* count */) { exitTest(TestResult::Failed, "kit segfault"); }
/// Intercept createStorage
virtual bool createStorage(const Poco::URI& /* uri */,
const std::string& /* jailRoot */,

View File

@ -33,6 +33,8 @@ public:
{
}
void kitSegfault(int /* count */) override { /* ignore */ }
std::unique_ptr<http::Response> assertPutFileRequest(const Poco::Net::HTTPRequest&) override
{
failTest("Unexpected PutFile when there should be no file on disk to upload");

View File

@ -1054,6 +1054,7 @@ void ForKitProcWSHandler::handleMessage(const std::vector<char> &data)
{
Admin::instance().addSegFaultCount(count);
LOG_INF(count << " coolkit processes crashed with segmentation fault.");
UnitWSD::get().kitSegfault(count);
}
else
{