Skip to content

Commit b1ff71a

Browse files
committed
Tests: fixed test preconditions in proxy_cache_lock_ssi.t.
Made sure that a proper request order exists between /locked and /ssi. Previously, request /locked could be proxied after subrequest /active, losing in the limit_req race. Also, request /locked was not properly delayed, thus proxy cache lock could not happen later in a subrequest. This somewhat reverts 714668aea2b0 as now inapplicable. While there, fixed a typo.
1 parent bcb0320 commit b1ff71a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Diff for: proxy_cache_lock_ssi.t

+7-4
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ http {
5151
proxy_cache_lock_timeout 100ms;
5252
5353
proxy_read_timeout 3s;
54-
55-
add_header X-Msec $msec;
5654
}
5755
5856
location = /ssi.html {
@@ -83,7 +81,7 @@ $t->run();
8381

8482
###############################################################################
8583

86-
# problem: if proxy cache lock wakeup happens in a an inactive
84+
# problem: if proxy cache lock wakeup happens in an inactive
8785
# subrequest, just a connection write event may not trigger any
8886
# further work
8987

@@ -94,9 +92,14 @@ $t->run();
9492
# is woken up by the postpone filter once first subrequest completes,
9593
# but this is suboptimal behaviour
9694

95+
http_get('/charge');
96+
my $start = time();
97+
9798
my $s = http_get('/locked', start => 1);
99+
select undef, undef, undef, 0.2;
100+
98101
like(http_get('/ssi.html'), qr/end/, 'cache lock ssi');
99-
my ($start) = http_end($s) =~ /X-Msec: (\d+)/;
102+
http_end($s);
100103
cmp_ok(time() - $start, '<=', 5, 'parallel execution after lock timeout');
101104

102105
###############################################################################

0 commit comments

Comments
 (0)