Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

[Test] Make test_pipeline_call_is_async less problematic. #1251

Merged
merged 9 commits into from
Sep 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tests/deepsparse/pipelines/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import numpy

import flaky
import pytest
from deepsparse.base_pipeline import BasePipeline
from deepsparse.pipeline import (
Expand Down Expand Up @@ -124,6 +125,7 @@ def test_pipeline_executor_num_workers():
assert executor._max_workers >= 1


@flaky.flaky(max_runs=2, min_passes=1)
@mock_engine(rng_seed=0)
def test_pipeline_call_is_async(engine_mock):
# attempts to verify that pipeline calls to engine are async
Expand Down Expand Up @@ -158,4 +160,4 @@ def sleep_then_engine_forward(xs, context):

# instead of doing a hard comparison of timing for each separate
# duration, do relative comparison of timing
assert numpy.allclose(dur_1_worker / dur_2_worker, 2, atol=0.1)
assert numpy.allclose(dur_1_worker / dur_2_worker, 2, atol=0.15)