Changeset d4dbc0


Ignore:
Timestamp:
2011-09-30 19:24:34 (3 years ago)
Author:
Poul-Henning Kamp <phk@…>
Branches:
master, 4.0, experimental-ims
Children:
7f56b9
Parents:
558ee9
git-author:
Poul-Henning Kamp <phk@…> (2011-09-30 19:24:34)
git-committer:
Poul-Henning Kamp <phk@…> (2011-09-30 19:24:34)
Message:

This test is much to brittle due to dependence on random timing.
Tighten it up with use of semaphores and collapse s1/s2/s3 using
"accept" keyword.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bin/varnishtest/tests/v00036.vtc

    ra4bc34 rd4dbc0  
    55        expect req.url == "/" 
    66        txresp -body "slash" 
     7        accept 
     8 
     9        sema r1 sync 3 
     10 
     11        rxreq 
     12        expect req.url == "/" 
     13        txresp -body "slash" 
     14        accept 
     15 
     16        rxreq 
     17        expect req.url == "/" 
     18        txresp -body "slash" 
     19 
     20        sema r3 sync 2 
     21        accept 
     22 
     23        rxreq 
     24        expect req.url == "/foo" 
     25        txresp -hdr "Foo: 1" -body "foobar" 
     26 
    727} -start 
    828 
     
    1131        expect req.url == "/" 
    1232        txresp -body "slash" 
     33        accept 
     34 
     35        sema r1 sync 3 
     36 
     37        rxreq 
     38        expect req.url == "/" 
     39        txresp -body "slash" 
     40 
     41        sema r2 sync 2 
     42        accept 
     43 
     44        rxreq 
     45        expect req.url == "/foo" 
     46        txresp -hdr "Foo: 2" -body "foobar" 
    1347} -start 
    1448 
     
    66100} -start 
    67101 
    68 # s1 & s2 have both had 1 probe, so both are unhealthy 
    69102 
    70103client c1 { 
     104        # s1 & s2 are both sick, expect response from s3 
    71105        txreq -url "/foo" 
    72106        rxresp 
    73107        expect resp.http.foo == "3" 
    74 } -run 
    75108 
    76 # setup for probe #2 
     109        sema r1 sync 3 
    77110 
    78 server s1 { 
    79         rxreq 
    80         expect req.url == "/" 
    81         txresp -body "slash" 
    82 } -start 
    83  
    84 server s2 { 
    85         rxreq 
    86         expect req.url == "/" 
    87         txresp -body "slash" 
    88 } -start 
    89  
    90 # if we muck with a running server, the test will wait until it's done, 
    91 # which will be after probe #2 completes. b2 will then be healthy. 
    92  
    93 server s2 { 
    94         rxreq 
    95         expect req.url == "/foo" 
    96         txresp -hdr "Foo: 2" -body "foobar" 
    97 } -start 
    98  
    99 client c1 { 
     111        # wait for s2 to become healthy 
     112        sema r2 sync 2 
    100113        txreq -url "/foo" 
    101114        rxresp 
    102115        expect resp.http.foo == "2" 
    103 } -run 
    104116 
    105 # setup for probe #3 
    106  
    107 server s1 { 
    108         rxreq 
    109         expect req.url == "/" 
    110         txresp -body "slash" 
    111 } -start 
    112  
    113 server s2 { 
    114         rxreq 
    115         expect req.url == "/" 
    116         txresp -body "slash" 
    117 } -start 
    118  
    119 # after probe #3 b1 should be healthy. 
    120  
    121 server s1 { 
    122         rxreq 
    123         expect req.url == "/foo" 
    124         txresp -hdr "Foo: 1" -body "foobar" 
    125 } -start 
    126  
    127 client c1 { 
     117        # wait for s1 to become healthy 
     118        sema r3 sync 2 
    128119        txreq -url "/foo" 
    129120        rxresp 
Note: See TracChangeset for help on using the changeset viewer.