commit | 986dd36e65aad9082f2bf13d5e7a25ea18110ead | [log] [tgz] |
---|---|---|
author | Motomu Utsumi <motomuman@google.com> | Thu Jun 06 18:04:08 2024 +0900 |
committer | Motomu Utsumi <motomuman@google.com> | Thu Jun 06 18:04:08 2024 +0900 |
tree | 3d841cac4c54110bcc4af58e9c39a3971e12ec17 | |
parent | b1d3a85f19ec1c8a0b05dd0ed7293364c44d006c [diff] |
waitForIdle to avoid stubbing mocked bpfNetMaps while CS is accessing Bug: 343302460 Test: TH Change-Id: I74683b20ce581206c47a153b0e2f348295363ecb
diff --git a/tests/unit/java/com/android/server/connectivityservice/CSBlockedReasonsTest.kt b/tests/unit/java/com/android/server/connectivityservice/CSBlockedReasonsTest.kt index 0590fbb..3ad8de8 100644 --- a/tests/unit/java/com/android/server/connectivityservice/CSBlockedReasonsTest.kt +++ b/tests/unit/java/com/android/server/connectivityservice/CSBlockedReasonsTest.kt
@@ -387,6 +387,10 @@ BLOCKED_REASON_NETWORK_RESTRICTED or BLOCKED_REASON_APP_BACKGROUND ) } + // waitForIdle since stubbing bpfNetMaps while CS handler thread calls + // bpfNetMaps.getNetPermForUid throws exception. + // ConnectivityService might haven't finished checking blocked status for all requests. + waitForIdle() // Disable background firewall chain doReturn(BLOCKED_REASON_NONE)