Skip to content

Commit 979561a

Browse files
committed
Try to wait more time
1 parent 6f64bcb commit 979561a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/src/androidTest/java/com/pcapplusplus/toyvpn/ToyVpnServiceManagerTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,15 @@ class ToyVpnServiceManagerTest {
137137
Log.e("TestReceiveVpnStartedAndStoppedEvent", "Before sending first broadcast")
138138
context.sendBroadcast(intent)
139139
Log.e("TestReceiveVpnStartedAndStoppedEvent", "After sending first broadcast")
140-
waitFor { serviceManager.vpnServiceState.value == VpnConnectionState.CONNECTED }
140+
waitFor(timeoutMillis = 20000L) { serviceManager.vpnServiceState.value == VpnConnectionState.CONNECTED }
141141
Log.e("TestReceiveVpnStartedAndStoppedEvent", "Passed first waitFor")
142-
waitFor { serviceManager.clientAddress.value == "10.0.0.1" }
142+
waitFor(timeoutMillis = 20000L) { serviceManager.clientAddress.value == "10.0.0.1" }
143143
Log.e("TestReceiveVpnStartedAndStoppedEvent", "Passed second waitFor")
144144

145145
Log.e("TestReceiveVpnStartedAndStoppedEvent", "Before sending second broadcast")
146146
context.sendBroadcast(Intent(BroadcastActions.VPN_SERVICE_STOPPED))
147147
Log.e("TestReceiveVpnStartedAndStoppedEvent", "After sending second broadcast")
148-
waitFor { serviceManager.vpnServiceState.value == VpnConnectionState.DISCONNECTED }
148+
waitFor(timeoutMillis = 20000L) { serviceManager.vpnServiceState.value == VpnConnectionState.DISCONNECTED }
149149
Log.e("TestReceiveVpnStartedAndStoppedEvent", "Passed third waitFor")
150150
}
151151

0 commit comments

Comments
 (0)