rainbows 4.4.3 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. data/.document +1 -0
  2. data/.gitignore +1 -0
  3. data/Documentation/rainbows.1.txt +8 -4
  4. data/GIT-VERSION-GEN +34 -35
  5. data/GNUmakefile +4 -2
  6. data/HACKING +72 -0
  7. data/bin/rainbows +5 -0
  8. data/lib/rainbows/const.rb +3 -3
  9. data/lib/rainbows/coolio/client.rb +18 -6
  10. data/lib/rainbows/coolio/thread_client.rb +2 -0
  11. data/lib/rainbows/epoll/client.rb +35 -12
  12. data/lib/rainbows/ev_core.rb +5 -4
  13. data/lib/rainbows/event_machine/client.rb +9 -4
  14. data/lib/rainbows/process_client.rb +7 -3
  15. data/lib/rainbows/response.rb +54 -18
  16. data/lib/rainbows/revactor/client/methods.rb +1 -1
  17. data/lib/rainbows/stream_response_epoll.rb +34 -15
  18. data/lib/rainbows/stream_response_epoll/client.rb +11 -3
  19. data/lib/rainbows/writer_thread_pool/client.rb +2 -0
  20. data/lib/rainbows/xepoll/client.rb +0 -3
  21. data/lib/rainbows/xepoll_thread_pool/client.rb +1 -1
  22. data/lib/rainbows/xepoll_thread_spawn/client.rb +1 -1
  23. data/rainbows.gemspec +6 -3
  24. data/t/GNUmakefile +10 -3
  25. data/t/byte-range-common.sh +1 -1
  26. data/t/hijack.ru +56 -0
  27. data/t/t0000-simple-http.sh +9 -9
  28. data/t/t0001-unix-http.sh +8 -8
  29. data/t/t0003-reopen-logs.sh +8 -8
  30. data/t/t0004-heartbeat-timeout.sh +3 -3
  31. data/t/t0005-large-file-response.sh +1 -1
  32. data/t/t0010-keepalive-timeout-effective.sh +2 -2
  33. data/t/t0011-close-on-exec-set.sh +2 -2
  34. data/t/t0017-keepalive-timeout-zero.sh +2 -2
  35. data/t/t0024-pipelined-sendfile-response.sh +2 -2
  36. data/t/t0027-nil-copy_stream.sh +1 -1
  37. data/t/t0030-fast-pipe-response.sh +1 -1
  38. data/t/t0034-pipelined-pipe-response.sh +2 -2
  39. data/t/t0035-kgio-pipe-response.sh +1 -1
  40. data/t/t0040-keepalive_requests-setting.sh +4 -4
  41. data/t/t0043-quit-keepalive-disconnect.sh +3 -3
  42. data/t/t0044-autopush.sh +2 -2
  43. data/t/t0045-client_max_header_size.sh +2 -2
  44. data/t/t0100-rack-input-hammer-chunked.sh +4 -4
  45. data/t/t0100-rack-input-hammer-content-length.sh +4 -4
  46. data/t/t0106-rack-input-keepalive.sh +6 -6
  47. data/t/t0200-async-response.sh +5 -5
  48. data/t/t0202-async-response-one-oh.sh +5 -5
  49. data/t/t0300-async_sinatra.sh +5 -5
  50. data/t/t0400-em-async-app.sh +2 -2
  51. data/t/t0401-em-async-tailer.sh +2 -2
  52. data/t/t0402-async-keepalive.sh +23 -23
  53. data/t/t0500-cramp-streaming.sh +3 -3
  54. data/t/t0600-rack-fiber_pool.sh +1 -1
  55. data/t/t0700-app-deferred.sh +2 -2
  56. data/t/t0800-rack-hijack.sh +27 -0
  57. data/t/t9000-rack-app-pool.sh +3 -3
  58. data/t/t9001-sendfile-to-path.sh +1 -1
  59. data/t/t9100-thread-timeout.sh +1 -1
  60. data/t/t9101-thread-timeout-threshold.sh +1 -1
  61. data/t/test-lib.sh +15 -0
  62. data/t/test_isolate.rb +4 -3
  63. metadata +26 -6
  64. data/t/bin/utee +0 -12
@@ -17,7 +17,7 @@ t_begin "setup and startup" && {
17
17
  }
18
18
 
19
19
  t_begin "send $nr_client concurrent requests" && {
20
- start=$(date +%s)
20
+ start=$(unix_time)
21
21
  for i in $(awk "BEGIN{for(i=0;i<$nr_client;++i) print i}" </dev/null)
22
22
  do
23
23
  (
@@ -26,17 +26,17 @@ t_begin "send $nr_client concurrent requests" && {
26
26
  ) &
27
27
  done
28
28
  wait
29
- t_info elapsed=$(( $(date +%s) - $start ))
29
+ t_info elapsed=$(( $(unix_time) - $start ))
30
30
  }
31
31
 
32
32
  t_begin "kill server" && kill $rainbows_pid
33
33
 
34
34
  t_begin "got $nr_client responses" && {
35
- test $nr_client -eq $(wc -l < $curl_out)
35
+ test $nr_client -eq $(count_lines < $curl_out)
36
36
  }
37
37
 
38
38
  t_begin "all responses identical" && {
39
- test 1 -eq $(sort < $curl_out | uniq | wc -l)
39
+ test 1 -eq $(sort < $curl_out | uniq | count_lines)
40
40
  }
41
41
 
42
42
  t_begin "sha1 matches on-disk sha1" && {
@@ -8,9 +8,9 @@ t_begin "setup and startup" && {
8
8
  rtmpfiles req
9
9
  rainbows -D sha1.ru -c $unicorn_config
10
10
  body=hello
11
- body_size=$(printf $body | wc -c)
11
+ body_size=$(printf $body | count_bytes)
12
12
  body_sha1=$(printf $body | rsha1)
13
- random_blob_size=$(wc -c < random_blob)
13
+ random_blob_size=$(count_bytes < random_blob)
14
14
  random_blob_sha1=$(rsha1 < random_blob)
15
15
  rainbows_wait_start
16
16
  }
@@ -34,7 +34,7 @@ t_begin "send big pipelined chunked requests" && {
34
34
 
35
35
  t_begin "check responses" && {
36
36
  dbgcat tmp
37
- test 4 -eq $(grep $random_blob_sha1 $tmp | wc -l)
37
+ test 4 -eq $(grep $random_blob_sha1 $tmp | count_lines)
38
38
  }
39
39
 
40
40
  t_begin "send big pipelined identity requests" && {
@@ -58,7 +58,7 @@ t_begin "send big pipelined identity requests" && {
58
58
 
59
59
  t_begin "check responses" && {
60
60
  dbgcat tmp
61
- test 3 -eq $(grep $random_blob_sha1 $tmp | wc -l)
61
+ test 3 -eq $(grep $random_blob_sha1 $tmp | count_lines)
62
62
  }
63
63
 
64
64
  t_begin "send pipelined identity requests" && {
@@ -83,7 +83,7 @@ t_begin "send pipelined identity requests" && {
83
83
 
84
84
  t_begin "check responses" && {
85
85
  dbgcat tmp
86
- test 3 -eq $(grep $body_sha1 $tmp | wc -l)
86
+ test 3 -eq $(grep $body_sha1 $tmp | count_lines)
87
87
  }
88
88
 
89
89
  t_begin "send pipelined chunked requests" && {
@@ -111,7 +111,7 @@ t_begin "send pipelined chunked requests" && {
111
111
 
112
112
  t_begin "check responses" && {
113
113
  dbgcat tmp
114
- test 3 -eq $(grep $body_sha1 $tmp | wc -l)
114
+ test 3 -eq $(grep $body_sha1 $tmp | count_lines)
115
115
  }
116
116
 
117
117
  t_begin "kill server" && kill $rainbows_pid
@@ -25,12 +25,12 @@ t_begin "setup and start" && {
25
25
  }
26
26
 
27
27
  t_begin "send async requests off in parallel" && {
28
- t0=$(date +%s)
29
- ( curl --no-buffer -sSf http://$listen/ 2>> $curl_err | utee $a) &
30
- ( curl --no-buffer -sSf http://$listen/ 2>> $curl_err | utee $b) &
31
- ( curl --no-buffer -sSf http://$listen/ 2>> $curl_err | utee $c) &
28
+ t0=$(unix_time)
29
+ ( curl --no-buffer -sSf http://$listen/ 2>> $curl_err | tee $a) &
30
+ ( curl --no-buffer -sSf http://$listen/ 2>> $curl_err | tee $b) &
31
+ ( curl --no-buffer -sSf http://$listen/ 2>> $curl_err | tee $c) &
32
32
  wait
33
- t1=$(date +%s)
33
+ t1=$(unix_time)
34
34
  }
35
35
 
36
36
  t_begin "ensure elapsed requests were processed in parallel" && {
@@ -16,13 +16,13 @@ t_begin "setup and start" && {
16
16
  }
17
17
 
18
18
  t_begin "send async requests off in parallel" && {
19
- t0=$(date +%s)
19
+ t0=$(unix_time)
20
20
  curl="curl -0 --no-buffer -vsSf http://$listen/"
21
- ( $curl 2>> $a_err | utee $a) &
22
- ( $curl 2>> $b_err | utee $b) &
23
- ( $curl 2>> $c_err | utee $c) &
21
+ ( $curl 2>> $a_err | tee $a) &
22
+ ( $curl 2>> $b_err | tee $b) &
23
+ ( $curl 2>> $c_err | tee $c) &
24
24
  wait
25
- t1=$(date +%s)
25
+ t1=$(unix_time)
26
26
  }
27
27
 
28
28
  t_begin "ensure elapsed requests were processed in parallel" && {
@@ -24,15 +24,15 @@ t_begin "setup and start" && {
24
24
  }
25
25
 
26
26
  t_begin "send async requests off in parallel" && {
27
- t0=$(date +%s)
28
- ( curl --no-buffer -sSf http://$listen/$n 2>> $curl_err | utee $a) &
29
- ( curl --no-buffer -sSf http://$listen/$n 2>> $curl_err | utee $b) &
30
- ( curl --no-buffer -sSf http://$listen/$n 2>> $curl_err | utee $c) &
27
+ t0=$(unix_time)
28
+ ( curl --no-buffer -sSf http://$listen/$n 2>> $curl_err | tee $a) &
29
+ ( curl --no-buffer -sSf http://$listen/$n 2>> $curl_err | tee $b) &
30
+ ( curl --no-buffer -sSf http://$listen/$n 2>> $curl_err | tee $c) &
31
31
  }
32
32
 
33
33
  t_begin "ensure elapsed requests were processed in parallel" && {
34
34
  wait
35
- t1=$(date +%s)
35
+ t1=$(unix_time)
36
36
  elapsed=$(( $t1 - $t0 ))
37
37
  echo "elapsed=$elapsed < 30"
38
38
  test $elapsed -lt 30
@@ -23,7 +23,7 @@ t_begin "setup and start" && {
23
23
  }
24
24
 
25
25
  t_begin "send async requests off in parallel" && {
26
- t0=$(date +%s)
26
+ t0=$(unix_time)
27
27
  curl --no-buffer -sSf http://$listen/ > $a 2>> $curl_err &
28
28
  curl --no-buffer -sSf http://$listen/ > $b 2>> $curl_err &
29
29
  curl --no-buffer -sSf http://$listen/ > $c 2>> $curl_err &
@@ -31,7 +31,7 @@ t_begin "send async requests off in parallel" && {
31
31
 
32
32
  t_begin "wait for curl terminations" && {
33
33
  wait
34
- t1=$(date +%s)
34
+ t1=$(unix_time)
35
35
  elapsed=$(( $t1 - $t0 ))
36
36
  t_info "elapsed=$elapsed"
37
37
  }
@@ -27,7 +27,7 @@ t_begin "setup and start" && {
27
27
  }
28
28
 
29
29
  t_begin "send async requests off in parallel" && {
30
- t0=$(date +%s)
30
+ t0=$(unix_time)
31
31
  curl --no-buffer -sSf http://$listen/ > $a 2>> $curl_err &
32
32
  curl_a=$!
33
33
  curl --no-buffer -sSf http://$listen/ > $b 2>> $curl_err &
@@ -49,7 +49,7 @@ t_begin "generate log output" && {
49
49
  t_begin "kill curls and wait for termination" && {
50
50
  kill $curl_a $curl_b $curl_c
51
51
  wait
52
- t1=$(date +%s)
52
+ t1=$(unix_time)
53
53
  elapsed=$(( $t1 - $t0 ))
54
54
  t_info "elapsed=$elapsed"
55
55
  }
@@ -28,7 +28,7 @@ t_begin "setup and start" && {
28
28
 
29
29
  t_begin "async.callback supports pipelining" && {
30
30
  rm -f $tmp
31
- t0=$(date +%s)
31
+ t0=$(unix_time)
32
32
  (
33
33
  cat $fifo > $tmp &
34
34
  printf 'GET /0 HTTP/1.1\r\nHost: example.com\r\n\r\n'
@@ -36,17 +36,17 @@ t_begin "async.callback supports pipelining" && {
36
36
  printf 'GET /2 HTTP/1.0\r\nHost: example.com\r\n\r\n'
37
37
  wait
38
38
  ) | socat - TCP:$listen > $fifo
39
- t1=$(date +%s)
39
+ t1=$(unix_time)
40
40
  elapsed=$(( $t1 - $t0 ))
41
41
  t_info "elapsed=$elapsed $model.$0 ($t_current)"
42
- test 3 -eq "$(fgrep 'HTTP/1.1 200 OK' $tmp | wc -l)"
43
- test 3 -eq "$(grep '^Hello ' $tmp | wc -l)"
44
- test 3 -eq "$(grep 'World ' $tmp | wc -l)"
42
+ test 3 -eq "$(fgrep 'HTTP/1.1 200 OK' $tmp | count_lines)"
43
+ test 3 -eq "$(grep '^Hello ' $tmp | count_lines)"
44
+ test 3 -eq "$(grep 'World ' $tmp | count_lines)"
45
45
  }
46
46
 
47
47
  t_begin "async.callback supports delayed pipelining" && {
48
48
  rm -f $tmp
49
- t0=$(date +%s)
49
+ t0=$(unix_time)
50
50
  (
51
51
  cat $fifo > $tmp &
52
52
  printf 'GET /0 HTTP/1.1\r\nHost: example.com\r\n\r\n'
@@ -56,17 +56,17 @@ t_begin "async.callback supports delayed pipelining" && {
56
56
  printf 'GET /2 HTTP/1.0\r\nHost: example.com\r\n\r\n'
57
57
  wait
58
58
  ) | socat - TCP:$listen > $fifo
59
- t1=$(date +%s)
59
+ t1=$(unix_time)
60
60
  elapsed=$(( $t1 - $t0 ))
61
61
  t_info "elapsed=$elapsed $model.$0 ($t_current)"
62
- test 3 -eq "$(fgrep 'HTTP/1.1 200 OK' $tmp | wc -l)"
63
- test 3 -eq "$(grep '^Hello ' $tmp | wc -l)"
64
- test 3 -eq "$(grep 'World ' $tmp | wc -l)"
62
+ test 3 -eq "$(fgrep 'HTTP/1.1 200 OK' $tmp | count_lines)"
63
+ test 3 -eq "$(grep '^Hello ' $tmp | count_lines)"
64
+ test 3 -eq "$(grep 'World ' $tmp | count_lines)"
65
65
  }
66
66
 
67
67
  t_begin "async.callback supports pipelining with delay $DELAY" && {
68
68
  rm -f $tmp
69
- t0=$(date +%s)
69
+ t0=$(unix_time)
70
70
  (
71
71
  cat $fifo > $tmp &
72
72
  printf 'GET /0 HTTP/1.1\r\nX-Delay: %d\r\n' $DELAY
@@ -77,43 +77,43 @@ t_begin "async.callback supports pipelining with delay $DELAY" && {
77
77
  printf 'Host: example.com\r\n\r\n'
78
78
  wait
79
79
  ) | socat - TCP:$listen > $fifo
80
- t1=$(date +%s)
80
+ t1=$(unix_time)
81
81
  elapsed=$(( $t1 - $t0 ))
82
82
  min=$(( $DELAY * 3 ))
83
83
  t_info "elapsed=$elapsed $model.$0 ($t_current) min=$min"
84
84
  test $elapsed -ge $min
85
- test 3 -eq "$(fgrep 'HTTP/1.1 200 OK' $tmp | wc -l)"
86
- test 3 -eq "$(grep '^Hello ' $tmp | wc -l)"
87
- test 3 -eq "$(grep 'World ' $tmp | wc -l)"
85
+ test 3 -eq "$(fgrep 'HTTP/1.1 200 OK' $tmp | count_lines)"
86
+ test 3 -eq "$(grep '^Hello ' $tmp | count_lines)"
87
+ test 3 -eq "$(grep 'World ' $tmp | count_lines)"
88
88
  }
89
89
 
90
90
  t_begin "async.callback supports keepalive" && {
91
- t0=$(date +%s)
91
+ t0=$(unix_time)
92
92
  curl -v --no-buffer -sSf http://$listen/[0-2] > $tmp 2>> $curl_err
93
- t1=$(date +%s)
93
+ t1=$(unix_time)
94
94
  elapsed=$(( $t1 - $t0 ))
95
95
  t_info "elapsed=$elapsed $model.$0 ($t_current)"
96
96
  cmp $expect $tmp
97
- test 2 -eq "$(fgrep 'Re-using existing connection!' $curl_err |wc -l)"
97
+ test 2 -eq "$(fgrep 'Re-using existing connection!' $curl_err |count_lines)"
98
98
  rm -f $curl_err
99
99
  }
100
100
 
101
101
  t_begin "async.callback supports keepalive with delay $DELAY" && {
102
- t0=$(date +%s)
102
+ t0=$(unix_time)
103
103
  curl -v --no-buffer -sSf -H "X-Delay: $DELAY" \
104
104
  http://$listen/[0-2] > $tmp 2>> $curl_err
105
- t1=$(date +%s)
105
+ t1=$(unix_time)
106
106
  elapsed=$(( $t1 - $t0 ))
107
107
  min=$(( $DELAY * 3 ))
108
108
  t_info "elapsed=$elapsed $model.$0 ($t_current) min=$min"
109
109
  test $elapsed -ge $min
110
110
  cmp $expect $tmp
111
- test 2 -eq "$(fgrep 'Re-using existing connection!' $curl_err |wc -l)"
111
+ test 2 -eq "$(fgrep 'Re-using existing connection!' $curl_err |count_lines)"
112
112
  rm -f $curl_err
113
113
  }
114
114
 
115
115
  t_begin "send async requests off in parallel" && {
116
- t0=$(date +%s)
116
+ t0=$(unix_time)
117
117
  curl --no-buffer -sSf http://$listen/[0-2] > $a 2>> $curl_err &
118
118
  curl --no-buffer -sSf http://$listen/[0-2] > $b 2>> $curl_err &
119
119
  curl --no-buffer -sSf http://$listen/[0-2] > $c 2>> $curl_err &
@@ -121,7 +121,7 @@ t_begin "send async requests off in parallel" && {
121
121
 
122
122
  t_begin "wait for curl terminations" && {
123
123
  wait
124
- t1=$(date +%s)
124
+ t1=$(unix_time)
125
125
  elapsed=$(( $t1 - $t0 ))
126
126
  t_info "elapsed=$elapsed"
127
127
  }
@@ -32,7 +32,7 @@ check () {
32
32
  i=0
33
33
  while read hello world
34
34
  do
35
- t1=$(date +%s)
35
+ t1=$(unix_time)
36
36
  diff=$(($t1 - $t0))
37
37
  t_info "i=$i diff=$diff hello=$hello world=$world"
38
38
  test $diff -ge 1 || echo "$i: diff: $diff < 1 second"
@@ -46,7 +46,7 @@ check () {
46
46
  }
47
47
 
48
48
  t_begin "send async requests off in parallel" && {
49
- t0=$(date +%s)
49
+ t0=$(unix_time)
50
50
  curl --no-buffer -sSf http://$listen/ 2>> $curl_err | check >$a 2>&1 &
51
51
  curl --no-buffer -sSf http://$listen/ 2>> $curl_err | check >$b 2>&1 &
52
52
  curl --no-buffer -sSf http://$listen/ 2>> $curl_err | check >$c 2>&1 &
@@ -54,7 +54,7 @@ t_begin "send async requests off in parallel" && {
54
54
 
55
55
  t_begin "wait for curl terminations" && {
56
56
  wait
57
- t1=$(date +%s)
57
+ t1=$(unix_time)
58
58
  elapsed=$(( $t1 - $t0 ))
59
59
  t_info "elapsed=$elapsed (should be 4-5s)"
60
60
  }
@@ -43,7 +43,7 @@ t_begin "no errors from curl" && {
43
43
  t_begin "no errors in stderr" && check_stderr
44
44
 
45
45
  t_begin "ensure we hit 3 separate fibers" && {
46
- test x3 = x"$(sort < $curl_out | uniq | wc -l)"
46
+ test x3 = x"$(sort < $curl_out | uniq | count_lines)"
47
47
  }
48
48
 
49
49
  t_done
@@ -25,8 +25,8 @@ t_begin "synchronous requests run in the same thread" && {
25
25
  curl --no-buffer -sSf http://$listen/ >> $sync_out 2>> $sync_err &
26
26
  wait
27
27
  test ! -s $sync_err
28
- test 3 -eq "$(wc -l < $sync_out)"
29
- test 1 -eq "$(uniq < $sync_out | wc -l)"
28
+ test 3 -eq "$(count_lines < $sync_out)"
29
+ test 1 -eq "$(uniq < $sync_out | count_lines)"
30
30
  }
31
31
 
32
32
  t_begin "deferred requests run in a different thread" && {
@@ -0,0 +1,27 @@
1
+ #!/bin/sh
2
+ . ./test-lib.sh
3
+ t_plan 5 "rack.hijack tests (Rack 1.5+ (Rack::VERSION >= [1,2]))"
4
+
5
+ t_begin "setup and start" && {
6
+ rainbows_setup
7
+ rainbows -D -c $unicorn_config hijack.ru
8
+ rainbows_wait_start
9
+ }
10
+
11
+ t_begin "check request hijack" && {
12
+ test "xrequest.hijacked" = x"$(curl -sSfv http://$listen/hijack_req)"
13
+ }
14
+
15
+ t_begin "check response hijack" && {
16
+ test "xresponse.hijacked" = x"$(curl -sSfv http://$listen/hijack_res)"
17
+ }
18
+
19
+ t_begin "killing succeeds" && {
20
+ kill $rainbows_pid
21
+ }
22
+
23
+ t_begin "check stderr" && {
24
+ check_stderr
25
+ }
26
+
27
+ t_done
@@ -19,14 +19,14 @@ t_begin "configure and start" && {
19
19
  }
20
20
 
21
21
  t_begin "launch $nr_client requests" && {
22
- start=$(date +%s)
22
+ start=$(unix_time)
23
23
  seq="$(awk "BEGIN{for(i=0;i<$nr_client;++i) print i}" </dev/null)"
24
24
  for i in $seq
25
25
  do
26
26
  curl -sSf http://$listen/ >> $curl_out 2>> $curl_err &
27
27
  done
28
28
  wait
29
- t_info elapsed=$(( $(date +%s) - $start ))
29
+ t_info elapsed=$(( $(unix_time) - $start ))
30
30
  }
31
31
 
32
32
  t_begin "kill server" && {
@@ -34,7 +34,7 @@ t_begin "kill server" && {
34
34
  }
35
35
 
36
36
  t_begin "$APP_POOL_SIZE instances of app were used" && {
37
- test $APP_POOL_SIZE -eq $(sort < $curl_out | uniq | wc -l)
37
+ test $APP_POOL_SIZE -eq $(sort < $curl_out | uniq | count_lines)
38
38
  }
39
39
 
40
40
  t_begin "no errors in curl stderr" && {
@@ -40,7 +40,7 @@ t_begin "X-Sendfile does not show up in headers" && {
40
40
  }
41
41
 
42
42
  t_begin "Content-Length is set correctly in headers" && {
43
- expect=$(wc -c < random_blob)
43
+ expect=$(count_bytes < random_blob)
44
44
  grep "^< Content-Length: $expect" $curl_err
45
45
  }
46
46
 
@@ -37,7 +37,7 @@ t_begin "short requests do not timeout while making a long one" && {
37
37
  test x"HI" = x"$(curl -sSf http://$listen/)"
38
38
  wait
39
39
  test -f $ok
40
- test 20 -eq $(grep '^HI$' $ok | wc -l)
40
+ test 20 -eq $(grep '^HI$' $ok | count_lines)
41
41
  test x = x"$(grep -v '^HI$' $ok)"
42
42
  grep 408 $curl_err
43
43
  }
@@ -23,7 +23,7 @@ t_begin "8 sleepy requests do not time out" && {
23
23
  2>> $curl_err >> $curl_out &
24
24
  done
25
25
  wait
26
- test 8 -eq "$(wc -l < $curl_out)"
26
+ test 8 -eq "$(count_lines < $curl_out)"
27
27
  test xHI = x"$(sort < $curl_out | uniq)"
28
28
  }
29
29
 
@@ -38,6 +38,21 @@ require_check () {
38
38
  fi
39
39
  }
40
40
 
41
+ # "date +%s" is not in POSIX, but in GNU, and FreeBSD 9.0 (possibly earlier)
42
+ unix_time () {
43
+ $RUBY -e 'puts Time.now.to_i'
44
+ }
45
+
46
+ # "wc -l" outputs leading whitespace on *BSDs, filter it out for portability
47
+ count_lines () {
48
+ wc -l | tr -d '[:space:]'
49
+ }
50
+
51
+ # "wc -c" outputs leading whitespace on *BSDs, filter it out for portability
52
+ count_bytes () {
53
+ wc -c | tr -d '[:space:]'
54
+ }
55
+
41
56
  skip_models () {
42
57
  for i in "$@"
43
58
  do
@@ -16,10 +16,11 @@ $stdout.reopen($stderr)
16
16
  lock = File.open(__FILE__, "rb")
17
17
  lock.flock(File::LOCK_EX)
18
18
  Isolate.now!(opts) do
19
- gem 'kgio', '2.7.4'
20
- gem 'kcar', '0.3.0'
19
+ gem 'kgio', '2.8.0'
20
+ gem 'rack', '1.5.2'
21
+ gem 'kcar', '0.4.0'
21
22
  gem 'raindrops', '0.10.0'
22
- gem 'unicorn', '4.3.1'
23
+ gem 'unicorn', '4.6.2'
23
24
 
24
25
  if engine == "ruby"
25
26
  gem 'sendfile', '1.1.0'