piwheels-rpi-crypto
dgtlmoon 7 months ago
parent 4ba847e481
commit 43ddfa5005

@ -10,6 +10,7 @@ def test_setup(live_server):
# Hard to just add more live server URLs when one test is already running (I think)
# So we add our test here (was in a different file)
def test_headers_in_request(client, live_server):
#ve_server_setup(live_server)
# Add our URL to the import page
test_url = url_for('test_headers', _external=True)
@ -378,13 +379,17 @@ def test_headers_textfile_in_request(client, live_server):
with open('test-datastore/' + extract_UUID_from_client(client) + '/headers.txt', 'w') as f:
f.write("watch-header: nice")
# seems to weird when run on github
time.sleep(2)
wait_for_all_checks(client)
client.get(url_for("form_watch_checknow"), follow_redirects=True)
# Give the thread time to pick it up
# Give the thread time to pick it up, this actually is not super reliable and pytest can terminate before the check is ran
wait_for_all_checks(client)
# WARNING - pytest and 'wait_for_all_checks' shuts down before it has actually stopped processing when using pyppeteer fetcher
# so adding more time here
if os.getenv('FAST_PUPPETEER_CHROME_FETCHER'):
time.sleep(6)
res = client.get(url_for("edit_page", uuid="first"))
assert b"Extra headers file found and will be added to this watch" in res.data

@ -121,6 +121,7 @@ def extract_UUID_from_client(client):
return uuid.strip()
def wait_for_all_checks(client):
# actually this is not entirely true, it can still be 'processing' but not in the queue
# Loop waiting until done..
attempt=0
# because sub-second rechecks are problematic in testing, use lots of delays

Loading…
Cancel
Save