Skip to content

Commit

Permalink
Merge pull request #833 from AMWA-TV/mocks-warm-up
Browse files Browse the repository at this point in the history
Mocks warm up
  • Loading branch information
garethsb committed Oct 5, 2023
2 parents ad0e39d + 215f736 commit ebd4787
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nmostesting/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
# Please consult the documentation for instructions on how to adjust these values for common testing setups including
# unicast DNS-SD and HTTPS testing.

# Number of seconds to wait after starting the mock DNS server, authorization server, etc. before running tests.
# This gives the API or client under test a chance to use these services before any test case is run.
MOCK_SERVICES_WARM_UP_DELAY = 0

# Enable or disable DNS-SD advertisements. Browsing is always permitted.
# The IS-04 Node tests create a mock registry on the network unless the `ENABLE_DNS_SD` parameter is set to `False`.
Expand Down
7 changes: 7 additions & 0 deletions nmostesting/NMOSTesting.py
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,13 @@ def main(args):
print(" * Testing tool running on 'http://{}:{}'. Version '{}'"
.format(get_default_ip(), core_app.config['PORT'], TOOL_VERSION))

# Give an API or client that is already running a chance to use the mock services
# before running any test cases
if CONFIG.MOCK_SERVICES_WARM_UP_DELAY:
print(" * Waiting for {} seconds to allow discovery of mock services"
.format(CONFIG.MOCK_SERVICES_WARM_UP_DELAY))
time.sleep(CONFIG.MOCK_SERVICES_WARM_UP_DELAY)

exit_code = 0
if "suite" not in vars(CMD_ARGS):
# Interactive testing mode. Await user input.
Expand Down

0 comments on commit ebd4787

Please sign in to comment.