Skip to content

Commit

Permalink
(debug)
Browse files Browse the repository at this point in the history
  • Loading branch information
ric-evans committed Jun 13, 2023
1 parent 1092d7f commit 65476f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions skydriver/database/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,11 @@ async def insert(self, entry: schema.ScanBacklogEntry) -> None:
LOGGER.debug(f"Inserted backlog entry for {entry.scan_id=}")

async def get_all(self) -> list[dict]:
"""Get all entries in backlog."""
LOGGER.debug("getting all entries in backlog")
"""Get all entries in backlog.
# atomically find & update
Doesn't include all fields.
"""
LOGGER.debug("getting all entries in backlog")
docs = [
d
async for d in self._collections[_SCAN_BACKLOG_COLL_NAME].find(
Expand Down
7 changes: 4 additions & 3 deletions tests/integration/test_backlog_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,12 @@ async def test_10(
print_it(entries)
assert len(entries) == i + 1

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

await asyncio.sleep(skydriver.config.ENV.SCAN_BACKLOG_RUNNER_DELAY * N_JOBS * 1.01)
entries = (await rc.request("GET", "/scans/backlog"))["entries"]
print_it(entries)

print_it(await rc.request("GET", "/scans/backlog"))
assert kapitsj_mock.call_count == N_JOBS - 1

# any extra calls?
Expand Down

0 comments on commit 65476f3

Please sign in to comment.