Skip to content

Commit

Permalink
fix the not working integrationstests (#169)
Browse files Browse the repository at this point in the history
* fix the not working integrationstests

* add comment about gc
  • Loading branch information
cqc-melf authored Jun 27, 2023
1 parent 3cb07bf commit df0c0e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/integration/backend_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from pathlib import Path
from typing import cast, Callable, Any # pylint: disable=unused-import
import json
import gc
import os
import time
from hypothesis import given, settings
Expand Down Expand Up @@ -398,9 +399,10 @@ def test_postprocess(
assert len(shots) == 10


@pytest.mark.flaky(reruns=3, reruns_delay=10)
@pytest.mark.skipif(skip_remote_tests, reason=REASON)
@pytest.mark.parametrize(
"authenticated_quum_backend", [{"device_name": "H2-1E"}], indirect=True
"authenticated_quum_backend", [{"device_name": "H1-1E"}], indirect=True
)
def test_simulator(
authenticated_quum_handler: QuantinuumAPI,
Expand All @@ -410,7 +412,7 @@ def test_simulator(
n_shots = 1000
state_backend = authenticated_quum_backend
stabilizer_backend = QuantinuumBackend(
"H2-1E", simulator="stabilizer", api_handler=authenticated_quum_handler
"H1-1E", simulator="stabilizer", api_handler=authenticated_quum_handler
)

circ = state_backend.get_compiled_circuit(circ)
Expand Down Expand Up @@ -458,9 +460,10 @@ def test_retrieve_available_devices(
assert len(backend_infos) > 0


@pytest.mark.flaky(reruns=3, reruns_delay=10)
@pytest.mark.skipif(skip_remote_tests, reason=REASON)
@pytest.mark.parametrize(
"authenticated_quum_backend", [{"device_name": "H2-1E"}], indirect=True
"authenticated_quum_backend", [{"device_name": "H1-1E"}], indirect=True
)
def test_batching(
authenticated_quum_backend: QuantinuumBackend,
Expand Down Expand Up @@ -705,6 +708,9 @@ def test_no_opt(authenticated_quum_backend: QuantinuumBackend) -> None:
"authenticated_quum_backend", [{"device_name": "H1-1SC"}], indirect=True
)
def test_qir_submission(authenticated_quum_backend: QuantinuumBackend) -> None:
# disable Garbage Collector because of
# https://github.com/CQCL/pytket-quantinuum/issues/170
gc.disable()
b = authenticated_quum_backend
qir = """; ModuleID = 'result_tag.bc'
source_filename = "qat-link"
Expand Down
1 change: 1 addition & 0 deletions tests/test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ hypothesis
requests_mock
llvmlite ~= 0.40.0
pytket-qir == 0.2.0rc11
pytest-rerunfailures

0 comments on commit df0c0e9

Please sign in to comment.