Skip to content

Commit

Permalink
Add test that demonstrates that RabbitMQ behaves according to spec
Browse files Browse the repository at this point in the history
Related to #273
  • Loading branch information
lukebakken committed Jul 8, 2024
1 parent 6696c6d commit da0418e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .ci/versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"erlang": "26.2.2",
"rabbitmq": "3.13.0"
"erlang": "26.2.5.1",
"rabbitmq": "3.13.4"
}
43 changes: 43 additions & 0 deletions integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,49 @@ func TestIntegrationQueueDeclarePassiveOnMissingExchangeShouldError(t *testing.T
}
}

// https://github.com/rabbitmq/amqp091-go/issues/273
// Note: RabbitMQ behaves according to spec.
// Passive declarations ignore everything but the queue name
// #themoreuknow
func TestIntegrationQueueDeclarePassiveOnQueueTypeMismatchShouldError(t *testing.T) {
c := integrationConnection(t, t.Name())
if c != nil {
defer c.Close()

ch, err := c.Channel()
if err != nil {
t.Fatalf("create channel1: %s", err)
}
defer ch.Close()

queueName := t.Name()

if _, err := ch.QueueDeclare(
queueName, // name
false, // durable
true, // auto-delete
false, // exclusive
false, // noWait
nil, // arguments
); err != nil {
t.Fatalf("queue declare: %s", err)
}

args := Table{QueueTypeArg: QueueTypeQuorum}

if _, err := ch.QueueDeclarePassive(
queueName, // name
false, // duration (note: not durable)
true, // auto-delete
false, // exclusive
false, // noWait
args, // arguments
); err != nil {
t.Fatal("QueueDeclarePassive with mismatched queue type should NOT error")
}
}
}

// https://github.com/streadway/amqp/issues/94
func TestIntegrationPassiveQueue(t *testing.T) {
c := integrationConnection(t, "queue")
Expand Down

0 comments on commit da0418e

Please sign in to comment.