Skip to content

Commit

Permalink
Merge pull request #775 from rabbitmq/mqtt-timeouts
Browse files Browse the repository at this point in the history
Bump timeouts for mqtt connection system tests, remove k8s 1.19 and 1.20 tests from PR workflow
  • Loading branch information
ChunyiLyu authored Jul 21, 2021
2 parents ce3bc0f + 3c7149b commit 825be3e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ jobs:
strategy:
matrix:
k8s:
- v1.19.11
- v1.20.7
- v1.21.1
rabbitmq-image:
- rabbitmq:3.8.8-management
Expand All @@ -79,6 +77,9 @@ jobs:
kind create cluster --image kindest/node:"$K8S_VERSION"
DOCKER_REGISTRY_SERVER=local-server OPERATOR_IMAGE=local-operator make deploy-kind
SUPPORT_VOLUME_EXPANSION=false make system-tests
- name: Setup tmate session
if: ${{ failure() }} # start a debugging tmate session when system tests fail
uses: mxschmitt/action-tmate@v3

kubectl_tests:
name: kubectl rabbitmq tests
Expand Down
3 changes: 2 additions & 1 deletion system_tests/system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"os"
"strconv"
"strings"
"time"

k8sresource "k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/types"
Expand Down Expand Up @@ -165,7 +166,7 @@ var _ = Describe("Operator", func() {
}
Eventually(getConfigMapAnnotations, 30, 1).Should(
HaveKey("rabbitmq.com/pluginsUpdatedAt"), "plugins ConfigMap should have been annotated")
Eventually(getConfigMapAnnotations, 120, 1).Should(
Eventually(getConfigMapAnnotations, 4 * time.Minute, 1).Should(
Not(HaveKey("rabbitmq.com/pluginsUpdatedAt")), "plugins ConfigMap annotation should have been removed")

Eventually(func() map[string][]byte {
Expand Down
8 changes: 4 additions & 4 deletions system_tests/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ func publishAndConsumeMQTTMsg(hostname, port, username, password string, overWeb
return true
}
return false
}, 15, 2).Should(BeTrue(), "Expected to be able to connect to MQTT port")
}, 30, 2).Should(BeTrue(), "Expected to be able to connect to MQTT port")

topic := "tests/mqtt"
msgReceived := false
Expand All @@ -868,11 +868,11 @@ func publishAndConsumeMQTTMsg(hostname, port, username, password string, overWeb

EventuallyWithOffset(1, func() bool {
return msgReceived
}, 5*time.Second).Should(BeTrue(), "Expect to receive message")
}, 10 * time.Second).Should(BeTrue(), "Expect to receive message")

token = c.Unsubscribe(topic)
ExpectWithOffset(1, token.Wait()).To(BeTrue())
ExpectWithOffset(1, token.Error()).ToNot(HaveOccurred())
ExpectWithOffset(1, token.Wait()).To(BeTrue(), "Unsubscribe token should return true")
ExpectWithOffset(1, token.Error()).ToNot(HaveOccurred(), "Unsubscribe token received error")

c.Disconnect(250)
}
Expand Down

0 comments on commit 825be3e

Please sign in to comment.