Skip to content

Commit e31e0ca

Browse files
WIP
1 parent 7c0b5f2 commit e31e0ca

5 files changed

Lines changed: 9 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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,17 @@ def controller.setup(container)
198198
include_context Async::Container::AController, "bad"
199199

200200
it "fails to start" do
201+
current_sigint = Signal.trap(:INT){Thread.main.raise(Interrupt)}
202+
current_sigterm = Signal.trap(:TERM){Thread.main.raise(Interrupt)}
203+
Console.info(self, "Traps were:", sigint: current_sigint, sigterm: current_sigterm)
204+
201205
expect(input.gets).to be == "Ready...\n"
202206

207+
$stderr.puts "Sending SIGINT to #{process_id}..."
203208
Process.kill(:INT, process_id)
204209

205210
# It was killed:
211+
$stderr.puts "Waiting for killed..."
206212
expect(input.gets).to be_nil
207213
end
208214
end

0 commit comments

Comments
 (0)