selfcompose: the hand pass is checked by the lock, not a quiet window; cite 721/AC2
Review round 1 of fd7f049e. The test of an ask while a pass runs waited a
fixed 50 ms for a pass made by hand not to begin. It now checks, while the
loop's pass is held, that the lock of a whole pass is taken (TryLock is
false), which needs no wall time and fails at once when compose takes no
lock; the pass made by hand must still end once the held pass did. Both
tests of the fix cite their criterion, 721/AC2.
Issue 721 (note 15, acceptance criterion 721/AC2).
This commit is contained in:
@@ -75,16 +75,16 @@ func composeAnsweredWhileAPassRuns(t *testing.T) {
|
||||
case <-time.After(2 * time.Second):
|
||||
t.Fatal("the verb compose gave no answer while a pass ran")
|
||||
}
|
||||
// Issue 721 note 11: a pass made by hand while the loop's runs waits for it to end, and never begins beside it.
|
||||
// 721/AC2: a pass made by hand while the loop's runs does not begin until that pass ends. While the loop's pass is held,
|
||||
// the lock of a whole pass is taken (no second pass can begin), and the pass made by hand ends once the held one did.
|
||||
byHand := make(chan struct{})
|
||||
go func() {
|
||||
defer close(byHand)
|
||||
c.compose(ctx)
|
||||
}()
|
||||
select {
|
||||
case <-reached:
|
||||
t.Error("a pass made by hand began while the loop's pass ran")
|
||||
case <-time.After(50 * time.Millisecond):
|
||||
if c.passMu.TryLock() {
|
||||
c.passMu.Unlock()
|
||||
t.Error("the loop's pass runs without the lock of a whole pass: a pass made by hand would begin beside it")
|
||||
}
|
||||
close(hold)
|
||||
select {
|
||||
|
||||
@@ -393,8 +393,8 @@ func testTheNodeComposesItsWantsFromTheBus(t *testing.T) {
|
||||
// Issue 1966 (novox, 2026-11-09): every pass names each wanted module it composed nothing of, or composed from the indexer's
|
||||
// manifest for want of a done build, with why, and a want it did not take; said once; the agent's word that it waits
|
||||
// hands a composition the node believes handed again.
|
||||
// The passes of this step are made by hand on a copy of what c holds, which runs no loop (issue 721 note 11): beside c's
|
||||
// loop, a pass it makes when an entry is answered composed tool too, and handed it on out (pipelines main.266, main.459, main.479).
|
||||
// 721/AC2: the passes of this step are made by hand on a copy of what c holds, which runs no loop: beside c's loop, a pass
|
||||
// it makes when an entry is answered composed tool too, and handed it on out (pipelines main.266, main.459, main.479).
|
||||
sc := c.scratch()
|
||||
sc.env.Running = nil // composed counts c's passes alone
|
||||
tfp := toolFp
|
||||
|
||||
Reference in New Issue
Block a user