Skip to content

factory tests: an idle pull is held to the bound of the watch it got - #2164

Merged
santoshkumarradha merged 3 commits into
app/v3from
c34/idle-pull
Nov 2, 2026
Merged

santoshkumarradha merged 3 commits into
app/v3from
c34/idle-pull

Conversation

@santoshkumarradha

Copy link
Copy Markdown
Member

What changes

TestAnIdlePullDoesNotRereadAnUnchangedFloor (added in #2122) failed on busy machines with "an idle one-second pull read the unchanged floor 12 times". When run alone, it passed.

The cause is not CPU timing. The factory follows its root with a filesystem watch, and opening one needs an inotify instance. Every process of the user draws from one shared pool, 128 by default. On a busy test machine the pool runs out, so the handler gets no watch. The pull then keeps its designed timed look every 100 ms: 2 reads plus 10 ticks gives exactly 12.

The test now asks the handler whether it watches its root:

  • With a watch: the bound stays at 3 reads, as before.
  • Without one: the test checks the timed look's own bound, one look per tick. Load cannot raise that count, because a ticker drops ticks rather than queueing them.

An internal test hook, WatchesItsRoot, reports which mode the handler is in.

Evidence

  • Reproduction: a temporary probe used up the process's inotify instances and then ran the old test. It failed with the same message, "read the unchanged floor 12 times".
  • The same probe with the new test: passes 3 runs out of 3, and logs that it checked the timed bound.
  • With a watch: the idle-pull test and TestAnOpenPullTakesAJobQueuedDuringItsWait pass 5 runs out of 5.

Limits

🤖 Generated with Claude Code

santoshkumarradha and others added 3 commits November 2, 2026 02:09
TestAnIdlePullDoesNotRereadAnUnchangedFloor failed on busy machines with
'read the unchanged floor 12 times'. Cause: fsnotify.NewWatcher fails when
the user's inotify instances (128 by default, shared by every process of
the user) are spent, so the handler has no filesystem watch and the pull
keeps its designed timed look, every 100 ms: 2 + 10 reads in one second.
Exhausting inotify in the test process reproduces exactly 12.

The test now asks whether the handler watches its root. With a watch it
keeps the bound of 3; without one it checks the timed look's own bound,
one look per tick, which load cannot raise because a ticker drops ticks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@santoshkumarradha
santoshkumarradha marked this pull request as ready for review November 2, 2026 08:49
@santoshkumarradha
santoshkumarradha merged commit fa96c37 into app/v3 Nov 2, 2026
@santoshkumarradha
santoshkumarradha deleted the c34/idle-pull branch November 2, 2026 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant