|
|
@@ -73,7 +73,7 @@ class TestClient(object): |
|
|
|
client = HTTPClient(baseurl = testurl, post_json = True) |
|
|
|
|
|
|
|
# start dummy filter |
|
|
|
pid = client.post("/filter/dummy", { "count": 30 }) |
|
|
|
pid = client.post("/filter/dummy", { "data": 30 }) |
|
|
|
eq_(client.get("/process/list"), [pid]) |
|
|
|
time.sleep(1) |
|
|
|
|
|
|
@@ -110,7 +110,7 @@ class TestClient(object): |
|
|
|
client = HTTPClient(baseurl = testurl, post_json = True) |
|
|
|
|
|
|
|
# Trigger exception in filter |
|
|
|
pid = client.post("/filter/dummy", { "count": -1 }) |
|
|
|
pid = client.post("/filter/dummy", { "data": -1 }) |
|
|
|
time.sleep(0.5) |
|
|
|
status = client.get("/process/status", { "pid": pid }) |
|
|
|
eq_(status["alive"], False) |
|
|
@@ -119,7 +119,7 @@ class TestClient(object): |
|
|
|
client.post("/process/remove", { "pid": pid }) |
|
|
|
|
|
|
|
# Kill a running filter by removing it early |
|
|
|
newpid = client.post("/filter/dummy", { "count": 30 }) |
|
|
|
newpid = client.post("/filter/dummy", { "data": 30 }) |
|
|
|
ne_(newpid, pid) |
|
|
|
time.sleep(0.5) |
|
|
|
status = client.post("/process/remove", { "pid": newpid }) |
|
|
@@ -131,7 +131,7 @@ class TestClient(object): |
|
|
|
|
|
|
|
# Try to remove a running filter that ignored SIGTERM |
|
|
|
# (can't be killed) |
|
|
|
pid = client.post("/filter/dummy", { "count": 0 }) |
|
|
|
pid = client.post("/filter/dummy", { "data": 0 }) |
|
|
|
with assert_raises(ServerError) as e: |
|
|
|
status = client.post("/process/remove", { "pid": pid }) |
|
|
|
in_("503 Service Unavailable", str(e.exception)) |
|
|
|