Skip to content

Commit

Permalink
test(network): remove unnecessary multi-threaded runtime from tests
Browse files Browse the repository at this point in the history
This prevents `MockService<zebra_state>` timeouts
in the `sync_block_too_high_extend_tips` test,
at the cost of reducing coverage of different execution orders.
  • Loading branch information
teor2345 committed Feb 9, 2022
1 parent 7f52081 commit dfeda1c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions zebrad/src/components/sync/tests/vectors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const MAX_SERVICE_REQUEST_DELAY: Duration = Duration::from_millis(1000);
/// Test that the syncer downloads genesis, blocks 1-2 using obtain_tips, and blocks 3-4 using extend_tips.
///
/// This test also makes sure that the syncer downloads blocks in order.
#[tokio::test(flavor = "multi_thread")]
#[tokio::test]
async fn sync_blocks_ok() -> Result<(), crate::BoxError> {
// Get services
let (
Expand Down Expand Up @@ -267,7 +267,7 @@ async fn sync_blocks_ok() -> Result<(), crate::BoxError> {
/// with duplicate block hashes.
///
/// This test also makes sure that the syncer downloads blocks in order.
#[tokio::test(flavor = "multi_thread")]
#[tokio::test]
async fn sync_blocks_duplicate_hashes_ok() -> Result<(), crate::BoxError> {
// Get services
let (
Expand Down Expand Up @@ -550,7 +550,7 @@ async fn sync_block_wrong_hash() -> Result<(), crate::BoxError> {
/// Test that the sync downloader rejects blocks that are too high in obtain_tips.
///
/// TODO: also test that it rejects blocks behind the tip limit. (Needs ~100 fake blocks.)
#[tokio::test(flavor = "multi_thread")]
#[tokio::test]
async fn sync_block_too_high_obtain_tips() -> Result<(), crate::BoxError> {
// Get services
let (
Expand Down Expand Up @@ -706,7 +706,7 @@ async fn sync_block_too_high_obtain_tips() -> Result<(), crate::BoxError> {
/// Test that the sync downloader rejects blocks that are too high in extend_tips.
///
/// TODO: also test that it rejects blocks behind the tip limit. (Needs ~100 fake blocks.)
#[tokio::test(flavor = "multi_thread")]
#[tokio::test]
async fn sync_block_too_high_extend_tips() -> Result<(), crate::BoxError> {
// Get services
let (
Expand Down Expand Up @@ -937,6 +937,8 @@ fn setup() -> (
MockService<zebra_state::Request, zebra_state::Response, PanicAssertion>,
MockChainTipSender,
) {
zebra_test::init();

let consensus_config = ConsensusConfig::default();
let state_config = StateConfig::ephemeral();
let config = ZebradConfig {
Expand Down

0 comments on commit dfeda1c

Please sign in to comment.