Skip to content

Commit

Permalink
Add test for invalid sequence number in long running witness operation.
Browse files Browse the repository at this point in the history
Signed-off-by: pfeairheller <[email protected]>
  • Loading branch information
pfeairheller committed Feb 24, 2024
1 parent 87300ea commit fa9eed3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/app/test_aiding.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,17 @@ def test_identifier_collection_end(helpers):

res = client.simulate_get(path=f"/operations/{name}")
assert res.status_code == 200
assert res.json['done'] is False

# Modify sequence number to test invalid sn
op = agent.monitor.opr.ops.get(keys=(name,))
op.metadata['sn'] = 4
agent.monitor.opr.ops.pin(keys=(name,), val=op)

res = client.simulate_get(path=f"/operations/{name}")
assert res.status_code == 200
assert res.json['done'] is False


assert len(agent.witners) == 1
res = client.simulate_get(path="/identifiers")
Expand Down
2 changes: 2 additions & 0 deletions tests/core/test_longrunning.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ def test_error(helpers):
except ValidationError as e:
err = e

assert err is not None

res = client.simulate_get(path="/operations")
assert isinstance(res.json, list)
assert len(res.json) == 1
Expand Down

0 comments on commit fa9eed3

Please sign in to comment.