From a2da42c53f53dfedc607aff7a35799225a83561a Mon Sep 17 00:00:00 2001 From: Florian Fischer <florian.fischer@muhq.space> Date: Sun, 16 Jan 2022 13:55:45 +0100 Subject: [PATCH] [TimeoutTest] fix timeout return assertion for linux 5.16 I could not identify the commit that changes this behavior but it is reproducible on our bigboxes and my arch system. --- tests/io/TimeoutTest.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/io/TimeoutTest.cpp b/tests/io/TimeoutTest.cpp index a46813c5..137e17ab 100644 --- a/tests/io/TimeoutTest.cpp +++ b/tests/io/TimeoutTest.cpp @@ -7,6 +7,7 @@ #include <cerrno> #include <cstdint> #include <cstring> +#include <memory> #include "Common.hpp" #include "CountingPrivateSemaphore.hpp" @@ -15,6 +16,7 @@ #include "emper.hpp" #include "fixtures/assert.hpp" #include "io.hpp" +#include "lib/LinuxVersion.hpp" using emper::io::ReadFuture; using emper::io::TimeoutWrapper; @@ -122,7 +124,8 @@ void writeTest() { ASSERT(res == -1); // write requests can't be canceled when in execution so this // will return as interupted - ASSERT(errno == EINTR); + const int err = errno; + ASSERT(err == EINTR || (EMPER_LINUX_GE("5.16.0") && err == ECANCELED)); emper::io::closeAndForget(efd); } -- GitLab