Class: HotCell::Fixtures::Spills

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

Overview

Writes a file where a library writes its scratch, Dir.tmpdir, and leaves it there — the way ImageMagick leaves its pixel cache behind on anything but a clean exit. With seconds: it then blocks, so the deadline kills it mid-request.

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, seconds: 0) ⇒ Object



483
484
485
486
487
488
489
# File 'lib/hot_cell/test_operations.rb', line 483

def perform(_inputs, _outputs, seconds: 0)
  spilled = File.join(Dir.tmpdir, "spill-#{Process.pid}")
  File.write spilled, "x"
  sleep seconds

  { spilled: spilled, home: ENV["HOME"] }
end