# This tests cancellation and unblocking subsequent requests.

init
rate:  2
burst: 4
read:  { perbatch: 1, perrequest: 1, perbyte: 0.1 }
write: { perbatch: 1, perrequest: 1, perbyte: 0.1 }
----
00:00:00.000

get_tenants
- 2
----
[2#1]

# Launch a request to consume two units.

launch
- { id: g1, tenant: 2, writerequests: 1, writebytes: 0 }
----
[g1@2]

await
[g1]
----
[]

# Launch a request requiring more quota than exists.

launch
- { id: g2, tenant: 2, writerequests: 1, writebytes: 100 }
----
[g2@2]

# Observe the timer indicating that the above request is blocked.

timers
----
00:00:01.000

# Launch another request which could be fulfilled by the existing quota.

launch
- { id: g3, tenant: 2, writerequests: 1, writebytes: 0 }
----
[g2@2, g3@2]

# Cancel the blocked request.

cancel
- g2
----
[g3@2]

# Observe that the previously blocked, second request proceeds.

await
- g3
----
[]
