End the composer's loop before its settings are restored
fix-a-bug-met-twice, the same kind as the shadows: the composer's loop of TestTheNodeComposesItsWantsFromTheBus ran on, until the deferred cancel, past the cleanup that restores composeAgain, laterAgain, passSaysEvery and slowAfter, which its passes read. The test now cancels it and waits for its out to close first. -race -count=50: 50 of 50, no race. Suspected, not fixed: the flake "the composer handed n1.tool.7777..., and nothing changed" (trunk line 691, 1 of 60 at review, 0 of 200 here), I think a compose-again pass handing a composition late after the issue 1966 step. Builds: design 47 H H-A-312
This commit is contained in:
@@ -280,6 +280,14 @@ func TestTheNodeComposesItsWantsFromTheBus(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// The composer's loop has ended (its out closed) before the test's cleanup restores composeAgain, laterAgain,
|
||||
// passSaysEvery and slowAfter, which its passes read (fix-a-bug-met-twice: a goroutine outliving the setting it reads,
|
||||
// as the shadows below).
|
||||
defer func() {
|
||||
cancel()
|
||||
for range out {
|
||||
}
|
||||
}()
|
||||
// oldie is placed and no want names it (a module at a build of the old form, nats on novox): the node runs it inside
|
||||
// its own composition, and composes it there again, even before the agent has applied anything (Running empty).
|
||||
oldie := `{"module":"oldie","version":"1","capabilities":["systemd"],"resources":[{"id":"service","type":"service","unit":"oldie.service","state":"running","boot":"enabled"}]}`
|
||||
|
||||
Reference in New Issue
Block a user