Sha256: 211643c55c0719f57b83752e84b0e8250ec8c08643d47209fd41c5ca27f7f187

Contents?: true

Size: 801 Bytes

Versions: 12

Compression:

Stored size: 801 Bytes

Contents

#!/bin/sh
. ./test-lib.sh
skip_models StreamResponseEpoll

t_plan 6 "keepalive_timeout tests for $model"

t_begin "setup and start" && {
	rainbows_setup
	rainbows -D env.ru -c $unicorn_config
	rainbows_wait_start
}

t_begin 'check server up' && {
	curl -sSf http://$listen/
}

t_begin "send keepalive response that does not expect close" && {
	req='GET / HTTP/1.1\r\nHost: example.com\r\n\r\n'
	t0=$(unix_time)
	(
		cat $fifo > $tmp &
		printf "$req"
		wait
		unix_time > $ok
	) | socat - TCP:$listen > $fifo
	now="$(cat $ok)"
	elapsed=$(( $now - $t0 ))
	t_info "elapsed=$elapsed (expecting >=5s)"
	test $elapsed -ge 5
}

t_begin 'keepalive not unreasonably long' && {
	test $elapsed -lt 15
}

t_begin "killing succeeds" && {
	kill $rainbows_pid
}

t_begin "check stderr" && {
	check_stderr
}

t_done

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rainbows-5.2.1 t/t0010-keepalive-timeout-effective.sh
rainbows-5.2.0 t/t0010-keepalive-timeout-effective.sh
rainbows-5.1.1 t/t0010-keepalive-timeout-effective.sh
rainbows-5.1.0 t/t0010-keepalive-timeout-effective.sh
rainbows-5.0.0.5.ge717 t/t0010-keepalive-timeout-effective.sh
rainbows-5.0.0 t/t0010-keepalive-timeout-effective.sh
rainbows-4.7.0 t/t0010-keepalive-timeout-effective.sh
rainbows-4.6.2 t/t0010-keepalive-timeout-effective.sh
rainbows-4.6.1 t/t0010-keepalive-timeout-effective.sh
rainbows-4.6.0.4.g4108 t/t0010-keepalive-timeout-effective.sh
rainbows-4.6.0 t/t0010-keepalive-timeout-effective.sh
rainbows-4.5.0 t/t0010-keepalive-timeout-effective.sh