Unverified Commit ce189b02 authored by Zelda Hessler's avatar Zelda Hessler Committed by GitHub
Browse files

Merge branch 'main' into zhessler-fix-const-names-in-codegen

parents 0baea0b8 1117dc75
Loading
Loading
Loading
Loading
+28 −1
Original line number Diff line number Diff line
@@ -10,3 +10,30 @@
# references = ["smithy-rs#920"]
# meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "client | server | all"}
# author = "rcoh"


[[aws-sdk-rust]]
message = "Fix panics that occurred when `Duration` for exponential backoff could not be created from too big a float."
references = ["aws-sdk-rust#1133"]
meta = { "breaking" = false, "tada" = false, "bug" = true }
author = "ysaito1001"

[[smithy-rs]]
message = "Fix panics that occurred when `Duration` for exponential backoff could not be created from too big a float."
references = ["aws-sdk-rust#1133"]
meta = { "breaking" = false, "tada" = false, "bug" = true, "target" = "client" }
author = "ysaito1001"

[[smithy-rs]]
message = "Clients now enforce that the Content-Length sent by the server matches the length of the returned response body. In most cases, Hyper will enforce this behavior, however, in extremely rare circumstances where the Tokio runtime is dropped in between subsequent requests, this scenario can occur."
references = ["smithy-rs#3491", "aws-sdk-rust#1079"]
meta = { "breaking" = false, "bug" = true, "tada" = false }
author = "rcoh"

[[aws-sdk-rust]]
message = "Clients now enforce that the Content-Length sent by the server matches the length of the returned response body. In most cases, Hyper will enforce this behavior, however, in extremely rare circumstances where the Tokio runtime is dropped in between subsequent requests, this scenario can occur."
references = ["aws-sdk-rust#1079"]
meta = { "breaking" = false, "bug" = true, "tada" = false }
author = "rcoh"

+10 −2
Original line number Diff line number Diff line
@@ -151,8 +151,16 @@ async fn write_get_object_response() {
    );

    let captured_request = req.expect_request();
    let uri_no_query = captured_request
        .uri()
        .splitn(2, '?')
        .into_iter()
        .next()
        .unwrap()
        .to_string();

    assert_eq!(
        captured_request.uri().to_string(),
        "https://req-route.s3-object-lambda.us-west-4.amazonaws.com/WriteGetObjectResponse?x-id=WriteGetObjectResponse"
        uri_no_query,
        "https://req-route.s3-object-lambda.us-west-4.amazonaws.com/WriteGetObjectResponse"
    );
}
+13 −1
Original line number Diff line number Diff line
@@ -270,7 +270,19 @@ async fn default_checksum_should_be_crc32_for_operation_requiring_checksum() {
        .send()
        .await;

    http_client.assert_requests_match(&[""]);
    let checksum_headers: Vec<_> = http_client
        .actual_requests()
        .last()
        .unwrap()
        .headers()
        .iter()
        .filter(|(key, _)| key.starts_with("x-amz-checksum"))
        .collect();

    assert_eq!(1, checksum_headers.len());
    assert_eq!("x-amz-checksum-crc32", checksum_headers[0].0);
    // FIXME(V1373841114): re-enable assertion after model updates
    // http_client.assert_requests_match(&[""]);
}

#[tokio::test]
+11 −12
Original line number Diff line number Diff line
@@ -11,9 +11,7 @@ use aws_sdk_s3::types::{
    OutputSerialization, SelectObjectContentEventStream,
};
use aws_sdk_s3::Client;
use aws_smithy_protocol_test::{assert_ok, validate_body, MediaType};
use aws_smithy_runtime::client::http::test_util::dvr::{Event, ReplayingClient};
use std::error::Error;

#[tokio::test]
async fn test_success() {
@@ -84,16 +82,17 @@ async fn test_success() {
        received
    );

    // FIXME(V1373841114): re-enable assertion after model updates
    // Validate the requests
    replayer
        .validate(&["content-type", "content-length"], body_validator)
        .await
        .unwrap();
    // replayer
    //     .validate(&["content-type", "content-length"], body_validator)
    //     .await
    //     .unwrap();
}

fn body_validator(expected_body: &[u8], actual_body: &[u8]) -> Result<(), Box<dyn Error>> {
    let expected = std::str::from_utf8(expected_body).unwrap();
    let actual = std::str::from_utf8(actual_body).unwrap();
    assert_ok(validate_body(actual, expected, MediaType::Xml));
    Ok(())
}
// fn body_validator(expected_body: &[u8], actual_body: &[u8]) -> Result<(), Box<dyn Error>> {
//     let expected = std::str::from_utf8(expected_body).unwrap();
//     let actual = std::str::from_utf8(actual_body).unwrap();
//     assert_ok(validate_body(actual, expected, MediaType::Xml));
//     Ok(())
// }
+0 −2
Original line number Diff line number Diff line
@@ -18,9 +18,7 @@ use std::net::SocketAddr;
use std::time::Duration;
use tracing::debug;

// TODO(https://github.com/smithy-lang/smithy-rs/issues/3523): Unignore this test
#[tokio::test]
#[ignore]
async fn test_too_short_body_causes_an_error() {
    // this is almost impossible to reproduce with Hyper—you need to do stuff like run each request
    // in its own async runtime. But there's no reason a customer couldn't run their _own_ HttpClient
Loading