nginx / unit

NGINX Unit - universal web app server - a lightweight and versatile open source server that simplifies the application stack by natively executing application code across eight different programming language runtimes.
https://unit.nginx.org
Apache License 2.0
5.37k stars 323 forks source link

Tests: NJS cacheable variables with access log #1188

Closed andrey-zelenkov closed 6 months ago

andrey-zelenkov commented 6 months ago

Reproduces issue https://github.com/nginx/unit/issues/1169.

andrey-zelenkov commented 6 months ago

Rebased and removed unused iterator.

% git range-diff afe8b31d...287fb378
 -:  -------- >  1:  0d99744d Router: match when pattern and tested string are both zero length
 -:  -------- >  2:  fdc46759 NJS: avoiding arithmetic ops with NULL pointer in r->args
 -:  -------- >  3:  8844d33c Fixed undefined behaviour in left shift of int value
 -:  -------- >  4:  7dcd6c0e Avoiding arithmetic ops with NULL pointer in nxt_http_arguments_parse
 -:  -------- >  5:  264b3755 Avoiding arithmetic ops with NULL pointer in nxt_port_mmap_get
 -:  -------- >  6:  c9461a6b Initialize port_impl only when it is needed
 -:  -------- >  7:  dd701fb4 Avoiding arithmetic ops with NULL pointer in nxt_unit_mmap_get
 -:  -------- >  8:  abcfc4cd Fix the security-alert email link in the README
 -:  -------- >  9:  9993814d NJS: loader should be registered using njs_vm_set_module_loader()
 1:  afe8b31d ! 10:  287fb378 Tests: NJS cacheable variables with access log
    @@ test/test_njs.py: def test_njs_variables_cacheable(temp_dir):
     +    ), 'access_log configure'
     +
     +    reqs = 50
    -+    for i in range(reqs):
    ++    for _ in range(reqs):
     +        client.get()
     +
     +    assert len(findall(r'localhost, 200', 'access.log')) == reqs