Skip to content

Commit

Permalink
fix infinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
mariostieriansys committed Feb 4, 2025
1 parent 7f39da5 commit 893e6de
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 4 additions & 2 deletions tests/example_tests/test_coverage_increase.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,18 +300,20 @@ def test_coverage_increase(tmpdir, pytestconfig: pytest.Config):
launcher.enshell_log_contents()
assert session.ensight.objs.core.PARTS[0] != session.ensight.objs.core.PARTS[1]
counter = 0
while True and counter < 5:
success = False
while not success and counter < 5:
try:
cas_file = session.download_pyansys_example(
"mixing_elbow.cas.h5", "pyfluent/mixing_elbow"
)
dat_file = session.download_pyansys_example(
"mixing_elbow.dat.h5", "pyfluent/mixing_elbow"
)
success = True
except Exception:
counter += 1
time.sleep(60)
if counter == 5:
if counter == 5 and not success:
raise RuntimeError("Couldn't download data from github")
session.load_data(cas_file, result_file=dat_file)
#
Expand Down
6 changes: 4 additions & 2 deletions tests/example_tests/test_dvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,20 @@ def test_dvs_data(tmpdir, pytestconfig: pytest.Config):
launcher = DockerLauncher(data_directory=data_dir, use_dev=True)
session = launcher.start()
counter = 0
while True and counter < 5:
success = False
while not success and counter < 5:
try:
cas_file = session.download_pyansys_example(
"mixing_elbow.cas.h5", "pyfluent/mixing_elbow"
)
dat_file = session.download_pyansys_example(
"mixing_elbow.dat.h5", "pyfluent/mixing_elbow"
)
success = True
except Exception:
counter += 1
time.sleep(60)
if counter == 5:
if counter == 5 and not success:
raise RuntimeError("Couldn't download data from github")
session.load_data(cas_file, result_file=dat_file)
dvs = None
Expand Down
6 changes: 4 additions & 2 deletions tests/example_tests/test_libuserd.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,20 @@ def test_libuserd_basic(tmpdir, pytestconfig: pytest.Config):
_ = libuserd.ansys_release_number()
_ = libuserd.ansys_release_string()
counter = 0
while True and counter < 5:
success = False
while not success and counter < 5:
try:
cas_file = libuserd.download_pyansys_example(
"mixing_elbow.cas.h5", "pyfluent/mixing_elbow"
)
dat_file = libuserd.download_pyansys_example(
"mixing_elbow.dat.h5", "pyfluent/mixing_elbow"
)
success = True
except Exception:
counter += 1
time.sleep(60)
if counter == 5:
if counter == 5 and not success:
raise RuntimeError("Couldn't download data from github")
r = libuserd.query_format(cas_file, dat_file)
d = r[0].read_dataset(cas_file, dat_file)
Expand Down

0 comments on commit 893e6de

Please sign in to comment.