DEV: Add test case for /srv/status probers (#9259)
This commit is contained in:
parent
4452817ed0
commit
58ae0d4bd9
|
@ -79,10 +79,18 @@ describe Middleware::RequestTracker do
|
|||
|
||||
Middleware::RequestTracker.log_request(data)
|
||||
|
||||
# /srv/status is never a tracked view because content-type is text/plain
|
||||
data = Middleware::RequestTracker.get_data(env(
|
||||
"HTTP_USER_AGENT" => "kube-probe/1.18",
|
||||
"REQUEST_URI" => "/srv/status?shutdown_ok=1",
|
||||
), ["200", { "Content-Type" => 'text/plain' }], 0.1)
|
||||
|
||||
Middleware::RequestTracker.log_request(data)
|
||||
|
||||
ApplicationRequest.write_cache!
|
||||
|
||||
expect(ApplicationRequest.http_total.first.count).to eq(3)
|
||||
expect(ApplicationRequest.http_2xx.first.count).to eq(3)
|
||||
expect(ApplicationRequest.http_total.first.count).to eq(4)
|
||||
expect(ApplicationRequest.http_2xx.first.count).to eq(4)
|
||||
|
||||
expect(ApplicationRequest.page_view_anon.first.count).to eq(2)
|
||||
expect(ApplicationRequest.page_view_crawler.first.count).to eq(1)
|
||||
|
|
Loading…
Reference in New Issue