|
75 | 75 | end |
76 | 76 |
|
77 | 77 | context "declared as quorum" do |
78 | | - it "is declared as durable and non-exclusive" do |
79 | | - q = channel.quorum_queue("bunny.qq.1", arguments: { |
| 78 | + it "is declared as durable and non-exclusive via MarchHare::Channel#quorum_queue" do |
| 79 | + q = channel.quorum_queue("march_hare.qq.#{rand}", arguments: { |
| 80 | + "x-quorum-initial-group-size" => 3 |
| 81 | + }) |
| 82 | + expect(q).to be_durable |
| 83 | + expect(q).not_to be_exclusive |
| 84 | + q.delete |
| 85 | + end |
| 86 | + |
| 87 | + it "is declared as durable and non-exclusive via MarchHare::Channel#queue with :type" do |
| 88 | + q = channel.queue("march_hare.qq.#{rand}", type: "quorum") |
| 89 | + expect(q).to be_durable |
| 90 | + expect(q).not_to be_exclusive |
| 91 | + q.delete |
| 92 | + end |
| 93 | + |
| 94 | + it "is declared as durable and non-exclusive via MarchHare::Channel#queue with x-queue-type" do |
| 95 | + q = channel.queue("march_hare.qq.#{rand}", arguments: { |
| 96 | + "x-queue-type" => "quorum", |
80 | 97 | "x-quorum-initial-group-size" => 3 |
81 | 98 | }) |
82 | 99 | expect(q).to be_durable |
83 | 100 | expect(q).not_to be_exclusive |
84 | 101 | q.delete |
85 | 102 | end |
| 103 | + |
| 104 | + it "is declared as a quorum queue" do |
| 105 | + q_name = "march_hare.qq.property_equivalence_check" |
| 106 | + q = channel.quorum_queue(q_name) |
| 107 | + |
| 108 | + # property equivalence check should not fail for these… |
| 109 | + _ = channel.queue(q_name, type: "quorum") |
| 110 | + _ = channel.queue(q_name, arguments: { |
| 111 | + "x-queue-type" => "quorum" |
| 112 | + }) |
| 113 | + |
| 114 | + # …but finally fails here |
| 115 | + expect do |
| 116 | + one_off_ch = connection.create_channel |
| 117 | + one_off_ch.queue(q_name, arguments: { |
| 118 | + "x-queue-type" => "classic" |
| 119 | + }) |
| 120 | + end.to raise_error(MarchHare::PreconditionFailed) |
| 121 | + |
| 122 | + expect(q).to be_durable |
| 123 | + expect(q).not_to be_exclusive |
| 124 | + q.delete |
| 125 | + end |
86 | 126 | end |
87 | 127 |
|
88 | 128 | context "declared as stream" do |
|
0 commit comments