Skip to content

Commit

Permalink
Fix various examples
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoh committed Sep 21, 2023
1 parent 3a4e5f5 commit 91ae6e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ async fn test_adaptive_retries_with_no_throttling_errors() {
let client = aws_sdk_dynamodb::Client::from_conf(config.clone());
let res = client.list_tables().send().await.unwrap();
assert_eq!(sleep_impl.total_duration(), Duration::from_secs(3));
assert_eq!(res.table_names(), Some(expected_table_names.as_slice()));
assert_eq!(res.table_names(), expected_table_names.as_slice());
// Three requests should have been made, two failing & one success
assert_eq!(conn.requests().len(), 3);

let client = aws_sdk_dynamodb::Client::from_conf(config.clone());
let res = client.list_tables().send().await.unwrap();
assert_eq!(sleep_impl.total_duration(), Duration::from_secs(3 + 1));
assert_eq!(res.table_names(), Some(expected_table_names.as_slice()));
assert_eq!(res.table_names(), expected_table_names.as_slice());
// Two requests should have been made, one failing & one success (plus previous requests)
assert_eq!(conn.requests().len(), 5);

Expand Down Expand Up @@ -141,15 +141,15 @@ async fn test_adaptive_retries_with_throttling_errors() {
let client = aws_sdk_dynamodb::Client::from_conf(config.clone());
let res = client.list_tables().send().await.unwrap();
assert_eq!(sleep_impl.total_duration(), Duration::from_secs(40));
assert_eq!(res.table_names(), Some(expected_table_names.as_slice()));
assert_eq!(res.table_names(), expected_table_names.as_slice());
// Three requests should have been made, two failing & one success
assert_eq!(conn.requests().len(), 3);

let client = aws_sdk_dynamodb::Client::from_conf(config.clone());
let res = client.list_tables().send().await.unwrap();
assert!(Duration::from_secs(48) < sleep_impl.total_duration());
assert!(Duration::from_secs(49) > sleep_impl.total_duration());
assert_eq!(res.table_names(), Some(expected_table_names.as_slice()));
assert_eq!(res.table_names(), expected_table_names.as_slice());
// Two requests should have been made, one failing & one success (plus previous requests)
assert_eq!(conn.requests().len(), 5);
}
2 changes: 1 addition & 1 deletion aws/sdk/integration-tests/webassembly/src/list_buckets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub async fn s3_list_buckets() {
let shared_config = get_default_config().await;
let client = Client::new(&shared_config);
let result = client.list_buckets().send().await.unwrap();
assert_eq!(result.buckets().unwrap().len(), 2)
assert_eq!(result.buckets().len(), 2)
}

#[tokio::test]
Expand Down

0 comments on commit 91ae6e7

Please sign in to comment.