From 199fcd0fe512f2fa4af63b0ec74e36aea7c4a8e1 Mon Sep 17 00:00:00 2001 From: Mithun Iyer Date: Mon, 9 Nov 2020 14:52:50 -0800 Subject: Skip `EventHUp` notify in `FIN_WAIT2` on a socket close. This Notify was added as part of cl/279106406; but notifying `EventHUp` in `FIN_WAIT2` is incorrect, as we want to only notify later on `TIME_WAIT` or a reset. However, we do need to notify any blocked waiters of an activity on the endpoint with `EventIn`|`EventOut`. PiperOrigin-RevId: 341490913 --- test/util/test_util.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/util') diff --git a/test/util/test_util.h b/test/util/test_util.h index 373c54f32..876ff58db 100644 --- a/test/util/test_util.h +++ b/test/util/test_util.h @@ -171,6 +171,7 @@ #include #include #include +#include #include #include @@ -271,6 +272,12 @@ PosixErrorOr> GetOpenFDs(); // Returns the number of hard links to a path. PosixErrorOr Links(const std::string& path); +inline uint64_t ms_elapsed(const struct timespec& begin, + const struct timespec& end) { + return (end.tv_sec - begin.tv_sec) * 1000 + + (end.tv_nsec - begin.tv_nsec) / 1000000; +} + namespace internal { template -- cgit v1.2.3