Skip to content
This repository was archived by the owner on Oct 23, 2022. It is now read-only.

Commit dc0c6a0

Browse files
committed
chore: tokio::test is now single-threaded
1 parent af19ed8 commit dc0c6a0

22 files changed

+83
-83
lines changed

http/src/v0.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ mod tests {
185185
routes(&ipfs, shutdown_tx)
186186
}
187187

188-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
188+
#[tokio::test]
189189
async fn not_found_as_plaintext() {
190190
let routes = testing_routes().await;
191191
let resp = warp::test::request()
@@ -199,7 +199,7 @@ mod tests {
199199
assert_eq!(resp.body(), "404 page not found");
200200
}
201201

202-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
202+
#[tokio::test]
203203
async fn invalid_peer_id_as_messageresponse() {
204204
let routes = testing_routes().await;
205205
let resp = warp::test::request()

http/src/v0/pubsub.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ mod tests {
548548
})
549549
}
550550

551-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
551+
#[tokio::test]
552552
async fn url_hacked_args() {
553553
let response = request()
554554
.path("/pubsub/pub?arg=some_channel&arg=foobar")
@@ -558,7 +558,7 @@ mod tests {
558558
assert_eq!(body, r#"{"message":"foobar","topic":"some_channel"}"#);
559559
}
560560

561-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
561+
#[tokio::test]
562562
async fn message_in_body() {
563563
let response = request()
564564
.path("/pubsub/pub?arg=some_channel")

http/src/v0/refs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ mod tests {
216216
use std::collections::HashSet;
217217
use std::convert::TryFrom;
218218

219-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
219+
#[tokio::test]
220220
async fn test_inner_local() {
221221
let filter = local(&*preloaded_testing_ipfs().await);
222222

@@ -263,7 +263,7 @@ mod tests {
263263
assert!(diff.is_empty(), "{:?}", diff);
264264
}
265265

266-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
266+
#[tokio::test]
267267
async fn refs_with_path() {
268268
let ipfs = preloaded_testing_ipfs().await;
269269

http/src/v0/root_files.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ mod tests {
303303
}
304304
}
305305

306-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
306+
#[tokio::test]
307307
async fn very_long_file_and_symlink_names() {
308308
let ipfs = Node::new("test_node").await;
309309

@@ -359,7 +359,7 @@ mod tests {
359359
assert_eq!(found, expected);
360360
}
361361

362-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
362+
#[tokio::test]
363363
async fn get_multiblock_file() {
364364
let ipfs = Node::new("test_node").await;
365365

http/src/v0/root_files/add.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ impl<D: fmt::Display> serde::Serialize for Quoted<D> {
378378
mod tests {
379379
use crate::v0::root_files::add;
380380

381-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
381+
#[tokio::test]
382382
async fn add_single_block_file() {
383383
let ipfs = tokio_ipfs().await;
384384

src/dag.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ mod tests {
600600
use super::*;
601601
use crate::{make_ipld, Node};
602602

603-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
603+
#[tokio::test]
604604
async fn test_resolve_root_cid() {
605605
let Node { ipfs, .. } = Node::new("test_node").await;
606606
let dag = IpldDag::new(ipfs);
@@ -610,7 +610,7 @@ mod tests {
610610
assert_eq!(res, data);
611611
}
612612

613-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
613+
#[tokio::test]
614614
async fn test_resolve_array_elem() {
615615
let Node { ipfs, .. } = Node::new("test_node").await;
616616
let dag = IpldDag::new(ipfs);
@@ -623,7 +623,7 @@ mod tests {
623623
assert_eq!(res, make_ipld!(2));
624624
}
625625

626-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
626+
#[tokio::test]
627627
async fn test_resolve_nested_array_elem() {
628628
let Node { ipfs, .. } = Node::new("test_node").await;
629629
let dag = IpldDag::new(ipfs);
@@ -636,7 +636,7 @@ mod tests {
636636
assert_eq!(res, make_ipld!(2));
637637
}
638638

639-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
639+
#[tokio::test]
640640
async fn test_resolve_object_elem() {
641641
let Node { ipfs, .. } = Node::new("test_node").await;
642642
let dag = IpldDag::new(ipfs);
@@ -651,7 +651,7 @@ mod tests {
651651
assert_eq!(res, make_ipld!(false));
652652
}
653653

654-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
654+
#[tokio::test]
655655
async fn test_resolve_cid_elem() {
656656
let Node { ipfs, .. } = Node::new("test_node").await;
657657
let dag = IpldDag::new(ipfs);
@@ -845,7 +845,7 @@ mod tests {
845845
);
846846
}
847847

848-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
848+
#[tokio::test]
849849
async fn resolve_through_link() {
850850
let Node { ipfs, .. } = Node::new("test_node").await;
851851
let dag = IpldDag::new(ipfs);
@@ -874,7 +874,7 @@ mod tests {
874874
}
875875
}
876876

877-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
877+
#[tokio::test]
878878
async fn fail_resolving_first_segment() {
879879
let Node { ipfs, .. } = Node::new("test_node").await;
880880
let dag = IpldDag::new(ipfs);
@@ -890,7 +890,7 @@ mod tests {
890890
assert_eq!(e.to_string(), format!("no link named \"1\" under {}", cid2));
891891
}
892892

893-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
893+
#[tokio::test]
894894
async fn fail_resolving_last_segment() {
895895
let Node { ipfs, .. } = Node::new("test_node").await;
896896
let dag = IpldDag::new(ipfs);
@@ -906,7 +906,7 @@ mod tests {
906906
assert_eq!(e.to_string(), format!("no link named \"a\" under {}", cid1));
907907
}
908908

909-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
909+
#[tokio::test]
910910
async fn fail_resolving_through_file() {
911911
let Node { ipfs, .. } = Node::new("test_node").await;
912912

@@ -938,7 +938,7 @@ mod tests {
938938
);
939939
}
940940

941-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
941+
#[tokio::test]
942942
async fn fail_resolving_through_dir() {
943943
let Node { ipfs, .. } = Node::new("test_node").await;
944944

src/ipns/dnslink.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@ pub async fn resolve(domain: &str) -> Result<IpfsPath, Error> {
120120
mod tests {
121121
use super::*;
122122

123-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
123+
#[tokio::test]
124124
#[ignore]
125125
async fn test_resolve1() {
126126
let res = resolve("ipfs.io").await.unwrap().to_string();
127127
assert_eq!(res, "/ipns/website.ipfs.io");
128128
}
129129

130-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
130+
#[tokio::test]
131131
#[ignore]
132132
async fn test_resolve2() {
133133
let res = resolve("website.ipfs.io").await.unwrap().to_string();

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1756,7 +1756,7 @@ mod tests {
17561756
use crate::make_ipld;
17571757
use multihash::Sha2_256;
17581758

1759-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
1759+
#[tokio::test]
17601760
async fn test_put_and_get_block() {
17611761
let ipfs = Node::new("test_node").await;
17621762

@@ -1769,7 +1769,7 @@ mod tests {
17691769
assert_eq!(block, new_block);
17701770
}
17711771

1772-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
1772+
#[tokio::test]
17731773
async fn test_put_and_get_dag() {
17741774
let ipfs = Node::new("test_node").await;
17751775

@@ -1779,7 +1779,7 @@ mod tests {
17791779
assert_eq!(data, new_data);
17801780
}
17811781

1782-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
1782+
#[tokio::test]
17831783
async fn test_pin_and_unpin() {
17841784
let ipfs = Node::new("test_node").await;
17851785

src/p2p/swarm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ mod tests {
265265
use libp2p::{multiaddr::Protocol, multihash::Multihash, swarm::Swarm};
266266
use std::convert::TryInto;
267267

268-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
268+
#[tokio::test]
269269
async fn swarm_api() {
270270
let (peer1_id, trans) = mk_transport();
271271
let mut swarm1 = Swarm::new(trans, SwarmApi::default(), peer1_id);

src/refs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ mod tests {
369369
assert_eq!(links, ["african.txt", "americas.txt", "australian.txt",]);
370370
}
371371

372-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
372+
#[tokio::test]
373373
async fn all_refs_from_root() {
374374
let Node { ipfs, .. } = preloaded_testing_ipfs().await;
375375

@@ -416,7 +416,7 @@ mod tests {
416416
assert_edges(&expected, all_edges.as_slice());
417417
}
418418

419-
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
419+
#[tokio::test]
420420
async fn all_unique_refs_from_root() {
421421
let Node { ipfs, .. } = preloaded_testing_ipfs().await;
422422

0 commit comments

Comments
 (0)