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 Aug 15, 2023
1 parent 6d6d1b2 commit c8f202f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ datamodels

- Remove ``jwst.datamodels.schema`` in favor of ``stdatamodels.schema`` [#7660]

engdb_tools
-----------

- Check alternative host is alive before attempting to run test for
access to avoid waiting the full timeout during test runs [#7780]

flat_field
----------

Expand Down
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 c8f202f

Please sign in to comment.