Rainbows! Rack HTTP server user/dev discussion
 help / color / mirror / code / Atom feed
blob ca8fcb117dcffd80f6d4cf08734d2a0dca4c2b2a 995 bytes (raw)
name: t/t0600-rack-fiber_pool.sh 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
 
#!/bin/sh
. ./test-lib.sh
case $model in
EventMachine) ;;
*)
	t_info "skipping $T since it's not compatible with $model"
	exit 0
	;;
esac

require_check rack/fiber_pool Rack::FiberPool

t_plan 6 "basic test with rack-fiber_pool gem"

CONFIG_RU=rack-fiber_pool/app.ru

t_begin "setup and start" && {
	rainbows_setup
	rtmpfiles curl_err curl_out

	rainbows -D -c $unicorn_config $CONFIG_RU
	rainbows_wait_start
}

t_begin "send requests off in parallel" && {
	curl --no-buffer -sSf http://$listen/ >> $curl_out 2>> $curl_err &
	curl --no-buffer -sSf http://$listen/ >> $curl_out 2>> $curl_err &
	curl --no-buffer -sSf http://$listen/ >> $curl_out 2>> $curl_err &
}

t_begin "wait for curl terminations" && {
	wait
}

t_begin "termination signal sent" && {
	kill $rainbows_pid
}

t_begin "no errors from curl" && {
	test ! -s $curl_err
}

t_begin "no errors in stderr" && check_stderr

# t_begin "ensure we hit 3 separate fibers" && {
# 	test x3 = x"$(sort < $curl_out | uniq | wc -l)"
# }

t_done

debug log:

solving ca8fcb1 ...
found ca8fcb1 in https://yhbt.net/rainbows-public/CAA2_N1ujCb8Yt4FGJNaTN0FdSk6g_iqL5N747Vcxt5etp9RnMw@mail.gmail.com/
found 01f28b5 in https://yhbt.net/rainbows.git/
preparing index
index prepared:
100755 01f28b5ef7148d47bf6ba8dfbf812294480cba7b	t/t0600-rack-fiber_pool.sh

applying [1/1] https://yhbt.net/rainbows-public/CAA2_N1ujCb8Yt4FGJNaTN0FdSk6g_iqL5N747Vcxt5etp9RnMw@mail.gmail.com/
diff --git a/t/t0600-rack-fiber_pool.sh b/t/t0600-rack-fiber_pool.sh
index 01f28b5..ca8fcb1 100755

Checking patch t/t0600-rack-fiber_pool.sh...
Applied patch t/t0600-rack-fiber_pool.sh cleanly.

index at:
100755 ca8fcb117dcffd80f6d4cf08734d2a0dca4c2b2a	t/t0600-rack-fiber_pool.sh

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/rainbows.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).