From a4a6bf96b96bad357ad828da55c09b1ecd69745b Mon Sep 17 00:00:00 2001 From: Landon James Date: Tue, 2 Dec 2025 11:09:33 -0800 Subject: [PATCH] Fixing test in aws_chunked inlineable --- aws/rust-runtime/Cargo.lock | 2 +- aws/rust-runtime/aws-inlineable/src/aws_chunked.rs | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/aws/rust-runtime/Cargo.lock b/aws/rust-runtime/Cargo.lock index 98b84aab926..cef5b968b90 100644 --- a/aws/rust-runtime/Cargo.lock +++ b/aws/rust-runtime/Cargo.lock @@ -70,7 +70,7 @@ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "aws-credential-types" -version = "1.2.10" +version = "1.2.11" dependencies = [ "async-trait", "aws-smithy-async", diff --git a/aws/rust-runtime/aws-inlineable/src/aws_chunked.rs b/aws/rust-runtime/aws-inlineable/src/aws_chunked.rs index bb647f248f4..9b1542b1ac1 100644 --- a/aws/rust-runtime/aws-inlineable/src/aws_chunked.rs +++ b/aws/rust-runtime/aws-inlineable/src/aws_chunked.rs @@ -184,6 +184,7 @@ mod tests { file.as_file_mut().write_all(line.as_bytes()).unwrap(); } + let stream_length = file.as_file().metadata().unwrap().len(); let request = HttpRequest::new( ByteStream::read_from() .path(&file) @@ -200,7 +201,7 @@ mod tests { let interceptor = AwsChunkedContentEncodingInterceptor; let mut cfg = ConfigBag::base(); cfg.interceptor_state() - .store_put(AwsChunkedBodyOptions::default()); + .store_put(AwsChunkedBodyOptions::default().with_stream_length(stream_length)); let runtime_components = RuntimeComponentsBuilder::for_tests().build().unwrap(); let mut ctx = InterceptorContext::new(Input::doesnt_matter()); ctx.enter_serialization_phase(); @@ -220,7 +221,12 @@ mod tests { body_data.extend_from_slice(&data.unwrap()) } let body_str = std::str::from_utf8(&body_data).unwrap(); - assert!(body_str.ends_with("0\r\n\r\n")); + + let expected = "This is a large file created for testing purposes 9999\r\n0\r\n\r\n"; + assert!( + body_str.ends_with(expected), + "expected '{body_str}' to end with '{expected}'" + ); } #[tokio::test]