From ab3722d3b35bb11103c8d9b192bd46ce8afbab30 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 22 Oct 2026 22:53:39 +0200 Subject: [PATCH] Test that a fill the node-engine failed is tried again when its socket returns (issue 1873) --- .../socket_integration_test.go | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/modules/mesh-provisioner-client/cmd/mesh-provisioner-client/socket_integration_test.go b/modules/mesh-provisioner-client/cmd/mesh-provisioner-client/socket_integration_test.go index 094a7e29..049b0be7 100644 --- a/modules/mesh-provisioner-client/cmd/mesh-provisioner-client/socket_integration_test.go +++ b/modules/mesh-provisioner-client/cmd/mesh-provisioner-client/socket_integration_test.go @@ -106,3 +106,38 @@ func TestWatchSocketWakesWhenTheSocketIsMadeAndWhenItsDirectoryReturns(t *testin defer l.Close() heard("the directory and socket back") } + +// Issue 1873: a fill the node-engine refused for a reason of its own (on ace, "read …/superuser.secret: is a +// directory", what a container runtime had left there) is tried again when a node-engine makes its socket again, as a +// newer engine may write what the older could not. Before, only a fill that failed for want of the socket was, so +// ace's postgres stayed unplaced after the engine that cures it was delivered, and its old failure was said every 30 s. +func TestNatsAFillTheEngineFailedIsTriedWhenTheSocketReturns(t *testing.T) { + b := startBus(t) + heard := b.listen(t) + e := newEngine(t, map[string]string{dunstrc: "owned"}) + if err := os.MkdirAll(e.at(dunstrc), 0o755); err != nil { + t.Fatal(err) + } + stop := e.listen(t) + b.config(t, "dunst", "font-size", "13") + b.assign(t, "dunst", dunst(t)) + aClient(t, b, e, t.TempDir()) + + eventually(t, "the engine's failure is said", func() bool { + r, _ := heard.last("dunst") + return r.Status == StatusFailed && strings.Contains(r.Reason, "is a directory") + }) + // The node-engine replaces itself with one that clears what the runtime left. + stop() + if err := os.Remove(e.at(dunstrc)); err != nil { + t.Fatal(err) + } + e.listen(t) + eventually(t, "dunstrc is written by the new engine", func() bool { + return strings.Contains(e.read(t, dunstrc), "Monospace 13") + }) + eventually(t, "and the report says applied", func() bool { + r, _ := heard.last("dunst") + return r.Status == StatusApplied + }) +}