Test the returning socket by a real restart of the stand-in node-engine

This commit is contained in:
2026-10-21 21:45:34 +02:00
parent 769a8d6f6a
commit aa5d263c08
@@ -751,17 +751,17 @@ func TestNatsAFillThatFailedForWantOfTheSocketIsTriedWhenTheSocketReturns(t *tes
func TestNatsAReturningSocketAsksNothingOfAModuleThatWasPlaced(t *testing.T) {
b := startBus(t)
e := startEngine(t, map[string]string{dunstrc: "owned"})
e := newEngine(t, map[string]string{dunstrc: "owned"})
stop := e.listen(t)
b.config(t, "dunst", "font-size", "13")
b.assign(t, "dunst", dunst(t))
c, _ := aClient(t, b, e, t.TempDir())
aClient(t, b, e, t.TempDir())
eventually(t, "dunstrc is filled", func() bool { return strings.Contains(e.read(t, dunstrc), "Monospace 13") })
_, before := e.counts(dunstrc)
// A socket-up wake with nothing unplaced, then a later change as the proof the loop has run past it.
up := make(chan struct{}, 1)
c.SocketUp = up
_ = up
// The node-engine replaces itself: the socket goes and returns, and a later change proves the loop ran past it.
stop()
e.listen(t)
b.config(t, "dunst", "font-size", "15")
eventually(t, "the change is written", func() bool { return strings.Contains(e.read(t, dunstrc), "Monospace 15") })
_, after := e.counts(dunstrc)