Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait for stats to be published in new management plugin #84

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bin/ci/before_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ $RABBITHOLE_RABBITMQCTL add_vhost /
$RABBITHOLE_RABBITMQCTL add_user guest guest
$RABBITHOLE_RABBITMQCTL set_permissions -p / guest ".*" ".*" ".*"

# Reduce retention policy for faster publishing of stats
$RABBITHOLE_RABBITMQCTL eval 'supervisor2:terminate_child(rabbit_mgmt_sup_sup, rabbit_mgmt_sup), application:set_env(rabbitmq_management, sample_retention_policies, [{global, [{605, 1}]}, {basic, [{605, 1}]}, {detailed, [{10, 1}]}]), rabbit_mgmt_sup_sup:start_child().'

$RABBITHOLE_RABBITMQCTL add_vhost "rabbit/hole"
$RABBITHOLE_RABBITMQCTL set_permissions -p "rabbit/hole" guest ".*" ".*" ".*"
9 changes: 5 additions & 4 deletions rabbithole_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func listConnectionsUntil(c *Client, i int) {
}

func awaitEventPropagation() {
time.Sleep(150 * time.Millisecond)
time.Sleep(1150 * time.Millisecond)
}

type portTestStruct struct {
Expand Down Expand Up @@ -127,6 +127,7 @@ var _ = Describe("Rabbithole", func() {
listConnectionsUntil(rmqc, 0)
conn := openConnection("/")

awaitEventPropagation()
xs, err := rmqc.ListConnections()
Ω(err).Should(BeNil())

Expand Down Expand Up @@ -303,7 +304,7 @@ var _ = Describe("Rabbithole", func() {

// give internal events a moment to be
// handled
time.Sleep(300 * time.Millisecond)
awaitEventPropagation()

xs, err := rmqc.ListChannels()
Ω(err).Should(BeNil())
Expand Down Expand Up @@ -341,7 +342,7 @@ var _ = Describe("Rabbithole", func() {

// give internal events a moment to be
// handled
time.Sleep(300 * time.Millisecond)
awaitEventPropagation()

xs, err := rmqc.ListConnections()
Ω(err).Should(BeNil())
Expand Down Expand Up @@ -372,7 +373,7 @@ var _ = Describe("Rabbithole", func() {

// give internal events a moment to be
// handled
time.Sleep(300 * time.Millisecond)
awaitEventPropagation()

xs, err := rmqc.ListChannels()
Ω(err).Should(BeNil())
Expand Down