Skip to content

Commit eb5d359

Browse files
committed
Auto merge of #11388 - arlosi:fix-waiting-tests, r=epage
Fix several tests that are waiting 60 seconds for publishing to time out Several tests are missing the pre-publishing hack to avoid the 60 second wait-for-publish timeout. r? `@epage`
2 parents 4d5c036 + 7cd6137 commit eb5d359

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

tests/testsuite/cargo_features.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,14 @@ fn publish_allowed() {
626626
)
627627
.file("src/lib.rs", "")
628628
.build();
629+
630+
// HACK: Inject `a` directly into the index so `publish` won't block for it to be in
631+
// the index.
632+
//
633+
// This is to ensure we can verify the Summary we post to the registry as doing so precludes
634+
// the registry from processing the publish.
635+
Package::new("a", "0.0.1").file("src/lib.rs", "").publish();
636+
629637
p.cargo("publish")
630638
.replace_crates_io(registry.index_url())
631639
.masquerade_as_nightly_cargo(&["test-dummy-unstable"])

tests/testsuite/inheritable_workspace_fields.rs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,15 @@ fn inherit_own_workspace_fields() {
160160
.file("bar.txt", "") // should be included when packaging
161161
.build();
162162

163+
// HACK: Inject `foo` directly into the index so `publish` won't block for it to be in
164+
// the index.
165+
//
166+
// This is to ensure we can verify the Summary we post to the registry as doing so precludes
167+
// the registry from processing the publish.
168+
Package::new("foo", "1.2.3")
169+
.file("src/lib.rs", "")
170+
.publish();
171+
163172
p.cargo("publish")
164173
.replace_crates_io(registry.index_url())
165174
.run();
@@ -287,6 +296,16 @@ fn inherit_own_dependencies() {
287296
assert!(lockfile.contains("dep"));
288297
assert!(lockfile.contains("dep-dev"));
289298
assert!(lockfile.contains("dep-build"));
299+
300+
// HACK: Inject `bar` directly into the index so `publish` won't block for it to be in
301+
// the index.
302+
//
303+
// This is to ensure we can verify the Summary we post to the registry as doing so precludes
304+
// the registry from processing the publish.
305+
Package::new("bar", "0.2.0")
306+
.file("src/lib.rs", "")
307+
.publish();
308+
290309
p.cargo("publish")
291310
.replace_crates_io(registry.index_url())
292311
.run();
@@ -411,6 +430,16 @@ fn inherit_own_detailed_dependencies() {
411430
p.cargo("check").run();
412431
let lockfile = p.read_lockfile();
413432
assert!(lockfile.contains("dep"));
433+
434+
// HACK: Inject `bar` directly into the index so `publish` won't block for it to be in
435+
// the index.
436+
//
437+
// This is to ensure we can verify the Summary we post to the registry as doing so precludes
438+
// the registry from processing the publish.
439+
Package::new("bar", "0.2.0")
440+
.file("src/lib.rs", "")
441+
.publish();
442+
414443
p.cargo("publish")
415444
.replace_crates_io(registry.index_url())
416445
.run();
@@ -628,6 +657,15 @@ fn inherit_workspace_fields() {
628657
.file("bar/bar.txt", "") // should be included when packaging
629658
.build();
630659

660+
// HACK: Inject `bar` directly into the index so `publish` won't block for it to be in
661+
// the index.
662+
//
663+
// This is to ensure we can verify the Summary we post to the registry as doing so precludes
664+
// the registry from processing the publish.
665+
Package::new("bar", "1.2.3")
666+
.file("src/lib.rs", "")
667+
.publish();
668+
631669
p.cargo("publish")
632670
.replace_crates_io(registry.index_url())
633671
.cwd("bar")
@@ -763,6 +801,16 @@ fn inherit_dependencies() {
763801
assert!(lockfile.contains("dep"));
764802
assert!(lockfile.contains("dep-dev"));
765803
assert!(lockfile.contains("dep-build"));
804+
805+
// HACK: Inject `bar` directly into the index so `publish` won't block for it to be in
806+
// the index.
807+
//
808+
// This is to ensure we can verify the Summary we post to the registry as doing so precludes
809+
// the registry from processing the publish.
810+
Package::new("bar", "0.2.0")
811+
.file("src/lib.rs", "")
812+
.publish();
813+
766814
p.cargo("publish")
767815
.replace_crates_io(registry.index_url())
768816
.cwd("bar")

0 commit comments

Comments
 (0)