You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/testsuite/publish.rs
+121Lines changed: 121 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4402,3 +4402,124 @@ See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for
4402
4402
"#]])
4403
4403
.run();
4404
4404
}
4405
+
4406
+
#[cargo_test]
4407
+
fnworkspace_publish_rate_limit_error(){
4408
+
// This test demonstrates the current behavior when workspace publishing
4409
+
// fails due to rate limiting. The error message doesn't indicate which
4410
+
// package failed or what packages remain to be published.
4411
+
4412
+
let registry = registry::RegistryBuilder::new()
4413
+
.http_api()
4414
+
.http_index()
4415
+
.add_responder("/api/v1/crates/new", |_req, _| {
4416
+
// For simplicity, let's just return rate limit error for all requests
4417
+
// This simulates hitting rate limit during workspace publish
4418
+
Response{
4419
+
code:429,
4420
+
headers:vec!["Retry-After: 3600".to_string()],
4421
+
body:format!(
4422
+
"You have published too many new crates in a short period of time. Please try again after Fri, 18 Jul 2025 20:00:34 GMT or email help@crates.io to have your limit increased."
[ERROR] failed to publish to registry at http://127.0.0.1:[..]/
4511
+
4512
+
Caused by:
4513
+
failed to get a 200 OK response, got 429
4514
+
headers:
4515
+
HTTP/1.1 429
4516
+
Content-Length: 172
4517
+
Connection: close
4518
+
Retry-After: 3600
4519
+
4520
+
body:
4521
+
You have published too many new crates in a short period of time. Please try again after Fri, 18 Jul 2025 20:00:34 GMT or email help@crates.io to have your limit increased.
0 commit comments