Skip to content

Commit ee0d25f

Browse files
committed
worker/tests: Use regular tokio::test
We've fixed these tests, so we don't need the `multi_thread` runtime flavor anymore.
1 parent a87037e commit ee0d25f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

crates/crates_io_worker/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ tracing = "=0.1.40"
2424
claims = "=0.7.1"
2525
crates_io_test_db = { path = "../crates_io_test_db" }
2626
insta = { version = "=1.41.1", features = ["json"] }
27-
tokio = { version = "=1.41.0", features = ["macros", "rt", "rt-multi-thread", "sync"]}
27+
tokio = { version = "=1.41.0", features = ["macros", "sync"]}

crates/crates_io_worker/tests/runner.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async fn job_is_locked(id: i64, conn: &mut AsyncPgConnection) -> bool {
4545
.is_none()
4646
}
4747

48-
#[tokio::test(flavor = "multi_thread")]
48+
#[tokio::test]
4949
async fn jobs_are_locked_when_fetched() {
5050
#[derive(Clone)]
5151
struct TestContext {
@@ -96,7 +96,7 @@ async fn jobs_are_locked_when_fetched() {
9696
assert!(!job_exists(job_id, &mut conn).await);
9797
}
9898

99-
#[tokio::test(flavor = "multi_thread")]
99+
#[tokio::test]
100100
async fn jobs_are_deleted_when_successfully_run() {
101101
#[derive(Serialize, Deserialize)]
102102
struct TestJob;
@@ -135,7 +135,7 @@ async fn jobs_are_deleted_when_successfully_run() {
135135
assert_eq!(remaining_jobs(&mut conn).await, 0);
136136
}
137137

138-
#[tokio::test(flavor = "multi_thread")]
138+
#[tokio::test]
139139
async fn failed_jobs_do_not_release_lock_before_updating_retry_time() {
140140
#[derive(Clone)]
141141
struct TestContext {
@@ -196,7 +196,7 @@ async fn failed_jobs_do_not_release_lock_before_updating_retry_time() {
196196
runner.wait_for_shutdown().await;
197197
}
198198

199-
#[tokio::test(flavor = "multi_thread")]
199+
#[tokio::test]
200200
async fn panicking_in_jobs_updates_retry_counter() {
201201
#[derive(Serialize, Deserialize)]
202202
struct TestJob;
@@ -232,7 +232,7 @@ async fn panicking_in_jobs_updates_retry_counter() {
232232
assert_eq!(tries, 1);
233233
}
234234

235-
#[tokio::test(flavor = "multi_thread")]
235+
#[tokio::test]
236236
async fn jobs_can_be_deduplicated() {
237237
#[derive(Clone)]
238238
struct TestContext {

0 commit comments

Comments
 (0)