Class: HotCell::Fixtures::SignalsSibling

Inherits:
Operation
  • Object
show all
Defined in:
lib/hot_cell/test_operations.rb

Constant Summary

Constants inherited from Operation

Operation::READ_BYTES

Instance Method Summary collapse

Methods inherited from Operation

abstract_operation, abstract_operation?, before_fork, before_worker_boot, inherited, limits, operation, operation_name, #run_tool, unreadable

Instance Method Details

#perform(_inputs, _outputs, signal:) ⇒ Object

Workers share a uid and a pid namespace, so one finds another by looking for a process the supervisor also fathered. This is the reproducer for the forged verdict: nothing here touches the victim's input, and the victim is holding an unrelated one.



195
196
197
198
199
200
# File 'lib/hot_cell/test_operations.rb', line 195

def perform(_inputs, _outputs, signal:)
  sibling = siblings.first
  Process.kill signal, sibling if sibling

  { signalled: sibling }
end