Skip to content

Commit

Permalink
Correctly modify state in test, we will need a hypervisor task that m…
Browse files Browse the repository at this point in the history
…arks old outgoing and incoming transfers as failed
  • Loading branch information
JBorrow committed Jun 18, 2024
1 parent 659a7f3 commit 5ab4f2b
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion tests/integration_test/test_send_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,25 @@ def test_send_from_existing_file_row(

if missing_files != []:
raise ValueError(f"Missing files: " + str(missing_files))
else:
print("All files copied successfully.")

# Callback can't work, so we need to modify our outgoing transfers
# to be compelted.
with source_session_maker() as session:
queue_item = (
session.query(test_orm.SendQueue)
.filter_by(destination="live_server", completed=True)
.first()
)

assert queue_item.consumed
assert queue_item.completed

for transfer in queue_item.transfers:
transfer.status = TransferStatus.COMPLETED

session.commit()

# Ok, now try to execute the send loop again. We should 409 and
# register a new remote instance internally.
Expand All @@ -342,7 +361,7 @@ def test_send_from_existing_file_row(
with source_session_maker() as session:
for file_name in copied_files:
file = session.get(test_orm.File, file_name)
if len(file.remote_instances) == 1:
if len(file.remote_instances) > 0:
found_remote_instanace = True
break

Expand Down

0 comments on commit 5ab4f2b

Please sign in to comment.