changeset 1291:3bc5df417f62

Tests: adjusted proxy variables time checks. Strict ">= 1" check may fail if timekeeping is not precise, and sleep(1) results in something like 0.999 time in headers. In particular, this happens when using clock_gettime(CLOCK_MONOTONIC_COARSE) for ngx_current_msec on Ubuntu 16.04. To fix this, sleep(1) replaced with select(1.1).
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 26 Feb 2018 18:09:32 +0300
parents 5ac4aae1a740
children e8eef0ebc548
files proxy_variables.t
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/proxy_variables.t
+++ b/proxy_variables.t
@@ -170,12 +170,12 @@ sub http_daemon {
 
 		if ($uri =~ 'bad' && $once) {
 			$once = 0;
-			sleep 1;
+			select undef, undef, undef, 1.1;
 			next;
 		}
 
 		if ($uri =~ 'header') {
-			sleep 1;
+			select undef, undef, undef, 1.1;
 		}
 
 		print $client <<EOF;
@@ -186,7 +186,7 @@ SEE-THIS-
 EOF
 
 		if ($uri =~ 'body') {
-			sleep 1;
+			select undef, undef, undef, 1.1;
 		}
 
 		print $client 'AND-THIS';