Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0->main] prometheus fix main #1006

Merged
merged 5 commits into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace eosio { namespace rest {
try {
auto res = self()->on_request(std::move(req));
if (!res)
not_found(target);
return not_found(target);
return *res;
} catch (std::exception& ex) { return server_error(ex.what()); }
}
Expand Down
2 changes: 2 additions & 0 deletions tests/TestHarness/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,8 @@ def processUrllibRequest(self, resource, command, payload={}, silentErrors=False
rtn = ex.read()
else:
unhandledEnumType(returnType)
elif returnType==ReturnType.raw:
return ex.code
else:
return None

Expand Down
2 changes: 2 additions & 0 deletions tests/plugin_http_api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1352,6 +1352,8 @@ def test_prometheusApi(self) :
self.assertTrue(int(metrics["blocks_produced"]) > 1)
self.assertTrue(int(metrics["last_irreversible"]) > 1)

ret = self.nodeos.processUrllibRequest(resource, "m", returnType = ReturnType.raw, method="GET", silentErrors= True, endpoint=endpointPrometheus)
self.assertTrue(ret == 404)

def test_multipleRequests(self):
"""Test keep-alive ability of HTTP plugin. Handle multiple requests in a single session"""
Expand Down