You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b8933a6
Browse filesBrowse the repository at this point in the historyBrowse files
Make monitor a better-behaved, more resilient citizen against real sites
Feature 3 of 4 requested large improvements. monitor hits real
third-party government sites it doesn't control; two gaps in how it
did that:
1. A single failed page load (browser::open) was reported as "Page
load: Fail" immediately, with no distinction between "this form is
genuinely down" and "the network hiccuped once." open() now retries
up to 3 times with backoff (500ms, then 1s) before giving up —
every attempt still has to fail for a real Fail to be reported.
Verified retry actually happens (not just fails once and gives up)
with a new tests/browser_test.rs: points at a file:// path that
doesn't exist on the first attempt (confirmed empirically that a
missing local file lands on the same chrome-error:// interstitial
as a real network failure, via a throwaway probe test before
committing to this design), then creates the file during open()'s
own retry backoff window. Verified this test is meaningful by
temporarily setting OPEN_ATTEMPTS to 1 and watching it fail exactly
as predicted, before restoring it.
2. monitor's concurrency (buffer_unordered(4)) starts all 4 forms at
once with no way to spread load over time — fine for formwatch's
own infrastructure, less fine for a large forms.yml hitting real
government sites. Added `--delay-ms` (default 0, unchanged
behavior) and extracted the pacing into a small `paced()` stream
combinator, directly unit-tested (pure timing logic, no browser
needed) rather than left untested inline: one test proves zero
delay adds no meaningful wait, another proves a real delay actually
spaces items out — verified meaningful by stripping the sleep out
of paced() and watching the second test catch it.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
0 commit comments