The node-engine's self-compose test lets no goroutine outlive a setting it reads (fix-a-bug-met-twice) #247
@@ -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