Skip to content

Commit 21960a4

Browse files
WIP
1 parent 7c0b5f2 commit 21960a4

5 files changed

Lines changed: 8 additions & 40 deletions

File tree

.github/workflows/test-external.yaml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ jobs:
4343
bundler-cache: true
4444

4545
- name: Run tests
46-
timeout-minutes: 10
47-
run: bundle exec sus --verbose
46+
timeout-minutes: 1
47+
run: CONSOLE_LEVEL=debug bundle exec sus --verbose test/async/container/controller.rb:200

lib/async/container/controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def run(signals: Async::Signals.default)
309309
end
310310
end
311311
rescue Interrupt
312-
self.stop(false)
312+
# Ignore - normal shutdown - can propagate from top level Sync.
313313
end
314314
end
315315
end

lib/async/container/forked.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,6 @@ def self.fork(**options)
104104
# Fork from `Thread.new` so the child does not inherit the parent fiber scheduler or the current caller's fiber stack. Only this short-lived thread is copied into the child process:
105105
::Thread.new do
106106
::Process.fork do
107-
# Convert process signals into pending interrupts on the surviving fork thread so they respect `Thread.handle_interrupt` in the child:
108-
::Signal.trap(:INT){::Thread.current.raise(::Interrupt)}
109-
::Signal.trap(:TERM){::Thread.current.raise(::Interrupt)}
110-
111107
# Reset interrupt masking - `Exception` is a fast path:
112108
::Thread.handle_interrupt(Exception => :immediate) do
113109
yield Instance.for(process)

test/async/container/controller.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,16 @@ def controller.setup(container)
198198
include_context Async::Container::AController, "bad"
199199

200200
it "fails to start" do
201+
Signal.trap(:INT){Thread.main.raise(Interrupt)}
202+
Signal.trap(:TERM){Thread.main.raise(Interrupt)}
203+
201204
expect(input.gets).to be == "Ready...\n"
202205

206+
$stderr.puts "Sending SIGINT to #{process_id}..."
203207
Process.kill(:INT, process_id)
204208

205209
# It was killed:
210+
$stderr.puts "Waiting for killed..."
206211
expect(input.gets).to be_nil
207212
end
208213
end

0 commit comments

Comments
 (0)