Skip to content

Commit d2c1775

Browse files
committed
Adding additional functionality for token bucket, including max capacity to accommodate multiple architectures
1 parent 261beac commit d2c1775

File tree

3 files changed

+153
-146
lines changed

3 files changed

+153
-146
lines changed

.github/workflows/manual-pull-request-bot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
contents: read
5757
needs:
5858
- get-pr-info
59-
runs-on: ubuntu-latest
59+
runs-on: smithy_ubuntu-latest_8-core
6060
steps:
6161
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
6262
- uses: actions/checkout@v4

aws/codegen-aws-sdk/src/test/kotlin/software/amazon/smithy/rustsdk/RetryPartitionTest.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ class RetryPartitionTest {
114114
"RetryPartition" to RuntimeType.smithyRuntime(ctx.runtimeConfig).resolve("client::retries::RetryPartition"),
115115
"RuntimeComponents" to RuntimeType.runtimeComponents(ctx.runtimeConfig),
116116
"TokenBucket" to RuntimeType.smithyRuntime(ctx.runtimeConfig).resolve("client::retries::TokenBucket"),
117+
"MAXIMUM_CAPACITY" to RuntimeType.smithyRuntime(ctx.runtimeConfig).resolve("client::retries::token_bucket::MAXIMUM_CAPACITY"),
117118
)
118119
crate.integrationTest("custom_retry_partition") {
119120
tokioTest("test_custom_token_bucket") {
@@ -139,7 +140,8 @@ class RetryPartitionTest {
139140
) -> Result<(), #{BoxError}> {
140141
self.called.fetch_add(1, Ordering::Relaxed);
141142
let token_bucket = cfg.load::<#{TokenBucket}>().unwrap();
142-
let expected = format!("permits: {}", tokio::sync::Semaphore::MAX_PERMITS);
143+
let max_capacity = #{MAXIMUM_CAPACITY};
144+
let expected = format!("permits: {}", max_capacity);
143145
assert!(
144146
format!("{token_bucket:?}").contains(&expected),
145147
"Expected debug output to contain `{expected}`, but got: {token_bucket:?}"

0 commit comments

Comments
 (0)