commit | a5500c6d058c9233621acba0969fbe258c127280 | [log] [tgz] |
---|---|---|
author | Patrick Rohr <prohr@google.com> | Thu Jul 28 15:43:21 2022 -0700 |
committer | Patrick Rohr <prohr@google.com> | Thu Jul 28 15:50:50 2022 -0700 |
tree | e1ac45b8e029f81f54c21b4a4886824dbc456c9e | |
parent | 7174d9d82cfe41803dfc0470d4fd6559bfd57033 [diff] |
PacketResponder: stop should wait for thread to join stop() calls interrupt which does not terminate the thread instantly. Therefore, it should wait for the thread to join, as otherwise the caller has no way of knowing when it is safe to close the underlying fd. This led to frequent test process crashes during EthernetManagerTest runs. Test: atest EthernetManagerTest Change-Id: I28f0d46c4f0295acffa5ec9f04964cd73d3de928
diff --git a/staticlibs/testutils/devicetests/com/android/testutils/PacketResponder.kt b/staticlibs/testutils/devicetests/com/android/testutils/PacketResponder.kt index daf29e4..964c6c6 100644 --- a/staticlibs/testutils/devicetests/com/android/testutils/PacketResponder.kt +++ b/staticlibs/testutils/devicetests/com/android/testutils/PacketResponder.kt
@@ -54,6 +54,7 @@ */ fun stop() { replyThread.interrupt() + replyThread.join() } private inner class ReplyThread(name: String) : Thread(name) {