mirror of
https://github.com/mudler/LocalAI.git
synced 2026-11-06 12:33:16 -05:00
test(slack): wait for the old link to drop before the restart reply
The restart spec closed the first runtime and started a second one at once. The fake server lists a link until its handler sees the socket close, so Connected was already true for the old link, and the reply the spec pushed next went to the closing socket and was lost. The spec failed on every run with one CPU and on about one run in three with more. Wait until the fake reports no link before the second runtime starts. 30 runs each at 1, 4 and 20 CPUs under -race now pass, also with six copies running at once. Assisted-by: Claude:claude-sonnet-5-5 go-test
This commit is contained in:
1 file changed
+4
@@ -131,6 +131,10 @@ var _ = Describe("which threads the bot follows", func() {
|
||||
info, _ := os.Stat(path)
|
||||
Expect(info.Mode().Perm()).To(Equal(os.FileMode(0o600)))
|
||||
b.rt.Close() // the add-on stops
|
||||
// The fake lists the old link until its handler sees the close. A
|
||||
// reply pushed before that goes to the closing socket and is lost, and
|
||||
// start would also take the old link for the new one.
|
||||
Eventually(func() bool { return f.Connected(appToken) }, 5*time.Second).Should(BeFalse())
|
||||
|
||||
b2 := start(f, dir, "own")
|
||||
f.Push(appToken, slacktest.Reply(channel, "U1", "after the restart", mention["ts"].(string)))
|
||||
|
||||
Reference in new issue
Block a user