-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test for of the child dies during the reexec
- Loading branch information
1 parent
d777b68
commit 0f53180
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
test/integration/_lib/fixtures/exit_during_upgrade/exiting_server.rb
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
require 'bundler/setup' | ||
require 'socket' | ||
require 'einhorn/worker' | ||
|
||
def einhorn_main | ||
serv = Socket.for_fd(Einhorn::Worker.socket!) | ||
Einhorn::Worker.ack! | ||
|
||
Signal.trap('USR2') do | ||
sleep 3 | ||
exit! | ||
end | ||
|
||
while true | ||
s, _ = serv.accept | ||
s.write($$) | ||
s.flush | ||
s.close | ||
end | ||
end | ||
|
||
einhorn_main if $0 == __FILE__ |
6 changes: 6 additions & 0 deletions
6
test/integration/_lib/fixtures/exit_during_upgrade/upgrade_reexec.rb
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
if [ "$1" = "--with-state-fd" ]; then | ||
sleep 6 | ||
fi | ||
exec bundle exec --keep-file-descriptors einhorn "$@" |
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