@@ -63,10 +63,12 @@ public class WifiStressTest
6363 private final static long WIFI_IDLE_MS = 60 * 1000 ;
6464
6565 /**
66- * The delay for Wi-Fi to get into idle, after screen off + WIFI_IDEL_MS + WIFI_IDLE_DELAY
67- * the Wi-Fi should be in idle mode and device should be in cellular mode.
66+ * Delay after issuing wifi shutdown.
67+ * The framework keep driver up for at leat 2 minutes to avoid problems
68+ * that a quick shutdown could cause on wext driver and protentially
69+ * on cfg based driver
6870 */
69- private final static long WIFI_IDLE_DELAY = 3 * 1000 ;
71+ private final static long WIFI_SHUTDOWN_DELAY = 2 * 60 * 1000 ;
7072
7173 private final static String OUTPUT_FILE = "WifiStressTestOutput.txt" ;
7274 private ConnectivityManagerTestActivity mAct ;
@@ -265,17 +267,17 @@ public void testWifiReconnectionAfterSleep() {
265267 PowerManager pm =
266268 (PowerManager )mRunner .getContext ().getSystemService (Context .POWER_SERVICE );
267269 assertFalse (pm .isScreenOn ());
268- sleep (WIFI_IDLE_MS , "Interruped while wait for wifi to be idle" );
270+ sleep (WIFI_IDLE_MS + WIFI_SHUTDOWN_DELAY , "Interruped while wait for wifi to be idle" );
269271 assertTrue ("Wait for Wi-Fi to idle timeout" ,
270272 mAct .waitForNetworkState (ConnectivityManager .TYPE_WIFI , State .DISCONNECTED ,
271273 6 * ConnectivityManagerTestActivity .SHORT_TIMEOUT ));
272274 if (!UtilHelper .isWifiOnly ()) {
273275 // use long timeout as the pppd startup may take several retries.
274276 assertTrue ("Wait for cellular connection timeout" ,
275277 mAct .waitForNetworkState (ConnectivityManager .TYPE_MOBILE , State .CONNECTED ,
276- ConnectivityManagerTestActivity .LONG_TIMEOUT ));
278+ 2 * ConnectivityManagerTestActivity .LONG_TIMEOUT ));
277279 }
278- sleep (mWifiSleepTime + WIFI_IDLE_DELAY , "Interrupted while device is in sleep mode" );
280+ sleep (mWifiSleepTime , "Interrupted while device is in sleep mode" );
279281 // Verify the wi-fi is still off and data connection is on
280282 assertEquals ("Wi-Fi is reconnected" , State .DISCONNECTED ,
281283 mAct .mCM .getNetworkInfo (ConnectivityManager .TYPE_WIFI ).getState ());
0 commit comments