-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop reconnect_on_network_failure loop on session#close
reopen session in case automatically_recover is called after close make explicit close handling more obvious on recovery
- Loading branch information
1 parent
ec70498
commit 13b98e9
Showing
4 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,16 @@ | |
end | ||
end | ||
|
||
context "when connection manually closed" do | ||
it "raises an exception on #automatically_recover" do | ||
c = MarchHare.connect(uri: "amqp://127.0.0.1") | ||
c.close | ||
expect { | ||
c.automatically_recover | ||
}.to raise_error(MarchHare::ConnectionClosedException) | ||
end | ||
end | ||
|
||
it "handles amqp:// URIs w/o path part" do | ||
c = MarchHare.connect(uri: "amqp://127.0.0.1") | ||
|
||
|
@@ -61,6 +71,7 @@ | |
end | ||
c = MarchHare.connect(executor_factory: factory, network_recovery_interval: 0) | ||
c.close | ||
c.instance_variable_set(:@was_explicitly_closed, false) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
andreaseger
Author
Contributor
|
||
c.automatically_recover | ||
c.close | ||
expect(calls).to eq(2) | ||
|
@@ -72,6 +83,7 @@ | |
expect(c).to be_connected | ||
c.close | ||
expect(c).not_to be_connected | ||
c.instance_variable_set(:@was_explicitly_closed, false) | ||
c.automatically_recover | ||
sleep 0.5 | ||
expect(c).to be_connected | ||
|
@@ -93,6 +105,7 @@ | |
expect(c).to be_connected | ||
c.close | ||
expect(c).not_to be_connected | ||
c.instance_variable_set(:@was_explicitly_closed, false) | ||
c.automatically_recover | ||
sleep 0.5 | ||
expect(c).to be_connected | ||
|
@@ -104,6 +117,7 @@ | |
expect(c).to be_connected | ||
c.close | ||
expect(c).not_to be_connected | ||
c.instance_variable_set(:@was_explicitly_closed, false) | ||
c.automatically_recover | ||
sleep 0.5 | ||
expect(c).to be_connected | ||
|
Please introduce a writer for this ivar.