Add identity-safe player moderation runtimes for T5 and T6
This commit is contained in:
@@ -66,9 +66,9 @@ def main():
|
||||
base = f"http://127.0.0.1:{http.server_address[1]}"
|
||||
env = {**os.environ, "NO_PROXY": "*", "no_proxy": "*"}
|
||||
|
||||
def probe(path, connect="1000", total="1000"):
|
||||
def probe(path, connect="1000", total="1000", cap=None):
|
||||
url = path if "://" in path else base + path
|
||||
completed = subprocess.run([str(executable), url, connect, total], env=env, capture_output=True, text=True, check=True, timeout=8)
|
||||
completed = subprocess.run([str(executable), url, connect, total] + ([] if cap is None else [str(cap)]), env=env, capture_output=True, text=True, check=True, timeout=8)
|
||||
return json.loads(completed.stdout)
|
||||
|
||||
normal = probe("/200", "-", "-")
|
||||
@@ -84,6 +84,11 @@ def main():
|
||||
assert timed_out["body_size"] == 0, timed_out
|
||||
if status: assert timed_out["first_byte_ms"] > 0, timed_out
|
||||
assert probe("/200")["curl_code"] == 0 # The next request completes after the stall.
|
||||
exact = probe("/200", cap=11)
|
||||
assert exact["curl_code"] == 0 and exact["body_size"] == 11, exact
|
||||
bounded = probe("/200", cap=10)
|
||||
assert bounded["curl_code"] == 23 and bounded["body_size"] == 0, bounded
|
||||
assert probe("/200")["body_size"] == 11
|
||||
slow = probe("/slow")
|
||||
assert slow["curl_code"] == 0 and slow["first_byte_ms"] >= 90, slow
|
||||
tls_url = f"https://127.0.0.1:{tls.server_address[1]}/"
|
||||
|
||||
Reference in New Issue
Block a user