Kong / ngx_wasm_module

Nginx + WebAssembly
Apache License 2.0
79 stars 7 forks source link

style(*) catch switch/case indentation #551

Closed hishamhm closed 3 months ago

hishamhm commented 3 months ago

See https://github.com/Kong/ngx_wasm_module/pull/530#discussion_r1635526128

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 90.36951%. Comparing base (223a346) to head (a4e425c).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/Kong/ngx_wasm_module/pull/551/graphs/tree.svg?width=650&height=150&src=pr&token=T0PT2Q9IAN&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kong)](https://app.codecov.io/gh/Kong/ngx_wasm_module/pull/551?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kong) ```diff @@ Coverage Diff @@ ## main #551 +/- ## =================================================== - Coverage 90.37921% 90.36951% -0.00970% =================================================== Files 47 47 Lines 10311 10311 =================================================== - Hits 9319 9318 -1 - Misses 992 993 +1 ``` | [Files](https://app.codecov.io/gh/Kong/ngx_wasm_module/pull/551?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kong) | Coverage Δ | | |---|---|---| | [src/wasm/ngx\_wasm\_ops.c](https://app.codecov.io/gh/Kong/ngx_wasm_module/pull/551?src=pr&el=tree&filepath=src%2Fwasm%2Fngx_wasm_ops.c&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kong#diff-c3JjL3dhc20vbmd4X3dhc21fb3BzLmM=) | `93.41085% <100.00000%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/Kong/ngx_wasm_module/pull/551/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kong) | [Flag](https://app.codecov.io/gh/Kong/ngx_wasm_module/pull/551/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kong) | Coverage Δ | | |---|---|---| | [unit](https://app.codecov.io/gh/Kong/ngx_wasm_module/pull/551/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kong) | `90.13820% <100.00000%> (-0.01105%)` | :arrow_down: | | [valgrind](https://app.codecov.io/gh/Kong/ngx_wasm_module/pull/551/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kong) | `81.21406% <62.50000%> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kong#carryforward-flags-in-the-pull-request-comment) to find out more.
casimiro commented 3 months ago

Nice one!

thibaultcha commented 3 months ago

Nice! One of the attach test cases seems to be flaky but it isn't clear which one, this failure happened a few times in the last couple days...

hishamhm commented 3 months ago

One of the attach test cases seems to be flaky but it isn't clear which one, this failure happened a few times in the last couple days...

Looks ilke it's TEST 8 (the only one that has shutdown_error_log and skip_no_debug). When I run it locally with Valgrind, I get that error on it too. If I run this loop:

i=0; while TEST_NGINX_USE_VALGRIND=1 util/test.sh t/04-openresty/ffi/103-proxy_wasm_attach.t; do i=$[i+1]; echo $i; done

I get this failure in under 20 iterations:

t/04-openresty/ffi/103-proxy_wasm_attach.t .. 57/56 
#   Failed test 't/04-openresty/ffi/103-proxy_wasm_attach.t TEST 8: attach() - plan is garbage collected after execution - pattern "(?^:\[debug\] .*? wasm freeing plan)" should match a line in error.log'
#   at /usr/share/perl/5.34/Test/Builder.pm line 193.
# Looks like you planned 56 tests but ran 57.
# Looks like you failed 1 test of 57 run.
t/04-openresty/ffi/103-proxy_wasm_attach.t .. Dubious, test returned 1 (wstat 256, 0x100)
All 56 subtests passed 
    (less 56 skipped subtests: 0 okay)

Test Summary Report
-------------------
t/04-openresty/ffi/103-proxy_wasm_attach.t (Wstat: 256 Tests: 57 Failed: 1)
  Failed test:  57
  Non-zero exit status: 1
  Parse errors: Bad plan.  You planned 56 tests but ran 57.
Files=1, Tests=57,  9 wallclock secs ( 0.02 usr  0.00 sys +  0.09 cusr  0.02 csys =  0.13 CPU)
Result: FAIL

If I add --- ONLY to TEST 8, the failure seems to happen right away (almost every time?).

If I remove TEST 8, the loop above runs to over 200 iterations with no errors.

thibaultcha commented 3 months ago

Flaky test fixed in #553.