Skip to content

Commit

Permalink
Wait for stats to be published in new management plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
dcorbacho committed Sep 1, 2016
1 parent 8855082 commit 4c5a930
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
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

0 comments on commit 4c5a930

Please sign in to comment.