低权重:提交低优先级请求,压力测试下预期会被拒绝。
(self)
| 108 | |
| 109 | @task(1) |
| 110 | def submit_low_priority_request(self): |
| 111 | """低权重:提交低优先级请求,压力测试下预期会被拒绝。""" |
| 112 | payload = _fixed_payload(data_type="DATA_SLICE", priority=1) |
| 113 | with self.client.post( |
| 114 | "/api/request", |
| 115 | json=payload, |
| 116 | catch_response=True, |
| 117 | name="/api/request[low_priority]", |
| 118 | ) as resp: |
| 119 | if resp.status_code not in (200, 400, 429): |
| 120 | resp.failure(f"Unexpected status: {resp.status_code}") |
| 121 | else: |
| 122 | resp.success() |
| 123 | |
| 124 | @task(1) |
| 125 | def check_health(self): |
nothing calls this directly
no test coverage detected