Measure the bar where it settles, not mid-spring

`widgets.spec.ts` took a one-shot `boundingBox()` of a fill that is still
moving. Two ways that reads wrong. "a bar draws a row per reading" compared
two widths that are both zero until the socket has delivered the readings,
and a plain `expect` over a captured number does not retry. "a reading over
its scale fills the track and no more" allowed the fill one pixel past the
track, but the house spring is underdamped: `motion`'s own generator puts the
fluksio look at 100.66% of the track 276ms in (material 100.91%, glass
103.58%), which on this tile's ~240px track is ~1.6px — over the tolerance,
and reached only if the sample happens to land near the peak.

Neither is the widget. `fractionOf` clamps the reading to [0, 1] and
`.dui-bar-track` is `overflow: hidden`, so nothing past a full track is ever
drawn; a bounding box just is not clipped by an ancestor's overflow. So both
now poll: one until the shorter reading is drawn shorter, the other until the
fill is flush with its track — which is a stricter reading of "and no more"
than the pixel of slack was.

The live-socket test gains the other half of what that spin cost: an ASGI
task that never returns is one uvicorn's graceful shutdown waits on forever,
which is why `fluksio serve` could only be SIGKILLed and left `serve.pid`
behind.
This commit is contained in:
2026-09-14 15:02:42 +02:00
parent 94c9260452
commit 4faf5312ff
2 changed files with 44 additions and 18 deletions
+6
View File
@@ -507,6 +507,12 @@ async def test_the_live_socket_ends_when_its_client_goes(
`receive_text` raises for good once the peer has gone, so reading it again
spun this loop at full tilt: the event loop stalled, `/health` answered
503 and one queue getter was orphaned per turn.
It is also what made `fluksio serve` unstoppable. A handler that never
returns is an ASGI task uvicorn never sees finish, and its graceful
shutdown waits on those with no timeout — so SIGTERM logged "Waiting for
background tasks to complete" and nothing else, leaving `serve.pid` behind
because only SIGKILL ended the process. This returning is what ends that.
"""
monkeypatch.setattr(flows_route, "user_from_token", lambda session, token: object())