Skip to content

Commit

Permalink
move delete
Browse files Browse the repository at this point in the history
  • Loading branch information
ric-evans committed Jun 13, 2023
1 parent 9fbfd00 commit ac77f38
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/integration/test_backlog_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,19 @@ async def test_10(
"""Test backlog job starting with multiple cancels."""
rc = server()

for i in range(N_JOBS + 1):
for i in range(N_JOBS):
resp = await rc.request("POST", "/scan", POST_SCAN_BODY)
entries = (await rc.request("GET", "/scans/backlog"))["entries"]
print_it(entries)
assert len(entries) == i + 1
if i == N_JOBS - 2:
await rc.request("DELETE", f"/scan/{resp['scan_id']}")

await rc.request("DELETE", f"/scan/{resp['scan_id']}")

await asyncio.sleep(skydriver.config.ENV.SCAN_BACKLOG_RUNNER_DELAY * N_JOBS * 1.01)
assert kapitsj_mock.call_count == N_JOBS
assert kapitsj_mock.call_count == N_JOBS - 1

# any extra calls?
await asyncio.sleep(skydriver.config.ENV.SCAN_BACKLOG_RUNNER_DELAY * 2)
assert kapitsj_mock.call_count == N_JOBS
assert kapitsj_mock.call_count == N_JOBS - 1

# need a rest route for seeing backlog
assert not (await rc.request("GET", "/scans/backlog"))["entries"]

0 comments on commit ac77f38

Please sign in to comment.