Files
maigret/tests
jichaowang02-langandGitHub b0b5bf68d2 Compare raw error percentage against threshold (don't round first) (#2809)
extract_and_group stored the per-error-type percentage already rounded to
2 decimals, and is_important() compares that stored value against the
threshold. Rounding before the comparison can push a rate that is strictly
below the threshold up to it:

    8 Captcha errors / 267 sites = 2.99625%
    round(2.99625, 2) == 3.0  ->  is_important() True  ->  spurious
    'Too many errors of type "Captcha" (3.0%)' warning

This is the residual of the same class fixed in #2788 (scale-then-round):
scaling to a percentage first stopped 2.5% from becoming 3.0%, but rounding
the percentage still feeds the threshold check. The display sites already
round (round(e["perc"], 2)), so storing the raw percentage keeps the shown
values unchanged while making the threshold comparison exact.

Genuine at-or-above-threshold rates still fire (3/100 = 3.0%, DNS 10%).
Adds a regression test for the 2.996% -> 3.0% rounding-up case.
2026-06-28 20:14:51 +02:00
..
2021-01-02 00:23:58 +03:00
2021-05-18 00:43:56 +03:00
2026-06-17 15:15:32 +02:00