Skip to content

Commit

Permalink
re-add quick check for alternative engineering database test
Browse files Browse the repository at this point in the history
The test_environmental test when not run on the vpn
will fail to contact the alternative engineering database
server. This results in the test taking ~10 minutes waiting
for a response before turning into a skip.

This commit adds some lines of code that were removed in
PR #3022 which changed the skip from a decorator to a
pytest.skip when the exception/timeout occurs. This should
allow the test to skip quickly when the host is not accessable
(and instead skips in <1 second). The pytest.skip call
during the except block is left to deal with cases when the
host resolves but the url fails to resolve.
  • Loading branch information
braingram committed Jul 28, 2023
1 parent 96247f1 commit 3579621
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions jwst/lib/tests/test_engdb_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ def engdb():
yield engdb


@pytest.mark.skipif(
not is_alive(ALTERNATE_HOST),
reason='Alternate test host not available.'
)
def test_environmental(jail_environ):
os.environ['ENG_BASE_URL'] = ALTERNATE_URL
try:
Expand Down

0 comments on commit 3579621

Please sign in to comment.