library-servers-bulk.test.cjs was flaky. Injecting delays found two
causes.
App (since dcbae2ef9, #1027): the agents hidden are known only from
/api/state. When the Library was opened before the first state came,
the page counted the hidden agents ("all 4 agents") and Turn all on
posted the servers to them too, and the page wasn't drawn again when
the state came. load() now notes the hidden agents before the state and
redraws the Library when they changed (window.redrawLibrary). With
/api/state delayed 1000ms in the test's server, main stays at "all 4
agents"; with the fix it says 3, and removing the redraw line makes the
new wait in the test time out.
Test: press() read the button's place while the page's content-in
animation still slid it 2px (the 2px of #1322), so a click could land off it. It now waits
until the Library's finite animations have ended. With content-in
slowed to 3s, the old press fails in both engines and the new one
passes. The test also waits for the Turn all on title to count 3 agents
before acting, which is what a reader sees.
Run: library-servers-bulk.test.cjs with the state delayed 260ms and
1000ms, chromium 3/3 each; 260ms webkit 2/2; undelayed, both engines.
Left open: under load (7-10 WebKit runs at once) about 1 run in 20-50
still fails on a chip in the Select bar, which the click re-wraps and
the scroll guard then holds by scrolling ~10px. Filed as #1537 with
what was logged.