Skip to content

Commit

Permalink
[Test] Make test_pipeline_call_is_async less problematic. (#1251)
Browse files Browse the repository at this point in the history
* initial commit

* initial commit

* quality

* make flaky

* increase the error bands

* cleanup

* add flaky after all...
  • Loading branch information
dbogunowicz committed Sep 18, 2023
1 parent 5a158ee commit 71ed9a7
Showing 1 changed file with 3 additions and 1 deletion.
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)

0 comments on commit 71ed9a7

Please sign in to comment.