t/GNUmakefile: cleanup test dependencies
[rainbows.git] / t / fork-sleep.ru
blob1523c25e413a6456b6a32eb0733ff080e00edd4d
1 # we do not want Rack::Lint or anything to protect us
2 use Rack::ContentLength
3 use Rack::ContentType, "text/plain"
4 trap(:CHLD) { $stderr.puts Process.waitpid2(-1).inspect }
5 map "/" do
6   time = ENV["nr"] || '15'
7   pid = fork { exec('sleep', time) }
8   run lambda { |env| [ 200, {}, [ "#{pid}\n" ] ] }
9 end