Poll DescribeTable until ACTIVE (up to 60s).
(c: &Client, name: &str)
| 360 | |
| 361 | /// Poll DescribeTable until ACTIVE (up to 60s). |
| 362 | pub async fn wait_for_active(c: &Client, name: &str) { |
| 363 | for _ in 0..60 { |
| 364 | if let Ok(resp) = c.describe_table().table_name(name).send().await { |
| 365 | if let Some(table) = resp.table() { |
| 366 | if table.table_status() == Some(&TableStatus::Active) { |
| 367 | return; |
| 368 | } |
| 369 | } |
| 370 | } |
| 371 | tokio::time::sleep(Duration::from_secs(1)).await; |
| 372 | } |
| 373 | panic!("Table {name} did not become ACTIVE within 60s"); |
| 374 | } |
| 375 | |
| 376 | /// Poll DescribeTable until the table no longer exists (up to 60s). |
| 377 | pub async fn wait_for_deleted(c: &Client, name: &str) { |
no test coverage detected