#5485 "A rule's page waits up to 25 s for its metric preview: a cold 24 h series read from plugin_metrics". Opening "Agent offline" took 25.6 s; a cold day of one series measured 18.3 s over MCP, a warm one 63 ms. The pickers still come with the page from plugin_metric_latest; the preview is its own request (hx-trigger=load), showing "Reading the last day…" until it lands. Picker swaps no longer read it either. #5486 "Send test where it can be found": the button moves from inside "What happens" to the page header beside History, its result under the verdict. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -316,5 +316,8 @@ async def test_a_rule_covering_hosts_lists_its_hosts_under_it(app):
|
||||
assert 'aria-expanded="false" aria-controls="hosts-p1"' in quiet
|
||||
assert '<tbody id="hosts-p1" class="row-children" hidden>' in quiet and "never fired" in quiet
|
||||
assert "Covers every host in <strong>swarm</strong>: 2 now (node-a, node-b)" in page
|
||||
# #5486: Send test sits in the page's header, its result under the verdict.
|
||||
assert page.index('hx-post="/alerts/rules/p1/test"') < page.index('id="rule-test-result"') \
|
||||
< page.index('id="rule-watches"')
|
||||
assert 'name="covers" value="group"' in page and "fixed once the rule exists" in page
|
||||
assert 'data-cover-resource hidden' in page
|
||||
|
||||
@@ -51,11 +51,14 @@ def test_the_pickers_and_the_preview_read_what_the_host_reports(app):
|
||||
_csrf="test-token", login_at=time.time())
|
||||
|
||||
resp = await client.get("/alerts/api/rule_target", query_string={
|
||||
"source_module": "host_agent", "pick_host": host})
|
||||
"source_module": "host_agent", "pick_host": host, "metric_name": "cpu_pct"})
|
||||
page = " ".join((await resp.get_data(as_text=True)).split())
|
||||
assert resp.status_code == 200
|
||||
assert f'<option value="{host}" selected>The whole host</option>' in page
|
||||
assert f'<optgroup label="Mounts"> <option value="{host}:/data" >/data</option>' in page
|
||||
# #5485: the pickers come without the preview, which loads in its own request.
|
||||
assert 'hx-get="/alerts/api/metric_preview" hx-trigger="load"' in page
|
||||
assert "Reading the last day" in page and "Now <strong>" not in page
|
||||
|
||||
resp = await client.get("/alerts/api/metric_preview", query_string={
|
||||
"source_module": "host_agent", "pick_host": host, "resource_name": f"{host}:/data",
|
||||
|
||||
Reference in New Issue
Block a user