Skip to content

Commit

Permalink
[TEST ONLY] Deflake TestMQTTSubRetainedRace by restarting the server
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
levb committed Dec 4, 2024
1 parent d7239ac commit 48cb413
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/mqtt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
})
}
Expand Down

0 comments on commit 48cb413

Please sign in to comment.