From 48cb413e931553d6f3b6b1529bb2809bbc39b926 Mon Sep 17 00:00:00 2001 From: Lev Brouk Date: Wed, 4 Dec 2024 06:30:12 -0800 Subject: [PATCH] [TEST ONLY] Deflake TestMQTTSubRetainedRace by restarting the server https://buildkite.com/synadia/nats-server-dev/builds/777#01938f20-ead7-4c99-8718-52440ac1b802 likely failed because of the prior message redelivery. The test client code is very sensitive to it. Hopefully restarting the server on every run will fix it - I have not been able to reproduce. --- server/mqtt_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/mqtt_test.go b/server/mqtt_test.go index 920e7c3597..1539159b2e 100644 --- a/server/mqtt_test.go +++ b/server/mqtt_test.go @@ -7089,8 +7089,6 @@ func TestMQTTSubjectMappingWithImportExport(t *testing.T) { func TestMQTTSubRetainedRace(t *testing.T) { o := testMQTTDefaultOptions() - s := testMQTTRunServer(t, o) - defer testMQTTShutdownServer(s) useCases := []struct { name string @@ -7108,6 +7106,9 @@ func TestMQTTSubRetainedRace(t *testing.T) { t.Run(subTopic, func(t *testing.T) { for _, qos := range QOS { t.Run(fmt.Sprintf("QOS%d", qos), func(t *testing.T) { + s := testMQTTRunServer(t, o) + defer testMQTTShutdownServer(s) + tc.f(t, o, subTopic, pubTopic, qos) }) }