1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
puma--puma/test/rackup/sleep.ru
MSP-Greg 67be653e10 tests - clean up - three commits (#1903)
* tests - cleanup rackup folder, add sleep.ru, add helpers/app.rb

* tests - change nextport to UniquePort.call, remove nextport, mutex

clean up, mutex removes port issues with parallel testing

* test_integration.rb - make UNIXSocket file names unique
2019-08-12 03:32:46 -07:00

9 lines
272 B
Ruby

# call with "GET /sleep<d> HTTP/1.1\r\n\r\n", where <d> is the number of
# seconds to sleep
# same as TestApps::SLEEP
run lambda { |env|
dly = (env['REQUEST_PATH'][/\/sleep(\d+)/,1] || '0').to_i
sleep dly
[200, {"Content-Type" => "text/plain"}, ["Slept #{dly}"]]
}