From 6a1d8f66f86506a0663f6576ac2bcb28a6569549 Mon Sep 17 00:00:00 2001 From: bunnie Date: Fri, 24 Mar 2023 01:28:56 +0800 Subject: [PATCH] give a little more margin in sleep stress test to recover/setup/shudown --- services/shellchat/src/cmds/sleep.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/services/shellchat/src/cmds/sleep.rs b/services/shellchat/src/cmds/sleep.rs index 42a3217bc..72cdd7679 100644 --- a/services/shellchat/src/cmds/sleep.rs +++ b/services/shellchat/src/cmds/sleep.rs @@ -93,19 +93,21 @@ impl<'a> ShellCmdApi<'a> for Sleep { let mut timeouts = 0; loop { log::info!("suspend/resume cycle: {} ({} timeouts)", iters, timeouts); - llio.set_wakeup_alarm(5).unwrap(); - ticktimer.sleep_ms(1000).ok(); + llio.set_wakeup_alarm(6).unwrap(); + ticktimer.sleep_ms(2000).ok(); match susres.initiate_suspend() { Err(xous::Error::Timeout) => { timeouts += 1; log::warn!("Couldn't suspend, a server was blocking suspend. ({}/{})\n", timeouts, iters); + // wait enough time for the wakeup alarm to have happened before resuming the cycle + ticktimer.sleep_ms(6000).unwrap(); } Ok(_) => {}, Err(e) => { log::error!("Unknown error on suspend: {:?}", e); } } - ticktimer.sleep_ms(3000 + (trng.get_u32().unwrap() % 7000) as usize).unwrap(); + ticktimer.sleep_ms(4000 + (trng.get_u32().unwrap() % 7000) as usize).unwrap(); iters += 1; } }