tests: shell: fix spurious errors in sets/0036add_set_element_expiration_0
Pablo Neira Ayuso
maintainerPATCH 1/1 tests: shell: fix spurious errors in sets/0036add_set_element_expiration_0
Add seconds as expiration, otherwise 14m59 reports 14m in minute granularity, this ensures suficient time in a very slow environment with debugging instrumentation.
---
I still see this failing occasionally due to timing issues, fix it.
tests/shell/testcases/sets/0036add_set_element_expiration_0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/shell/testcases/sets/0036add_set_element_expiration_0 +1 -1
@@ -8,7 +8,7 @@ drop_seconds() { RULESET="add table ip x add set ip x y { type ipv4_addr; flags dynamic,timeout; } -add element ip x y { 1.1.1.1 timeout 30m expires 15m }" +add element ip x y { 1.1.1.1 timeout 30m expires 15m59s }" test_output=$($NFT -e -f - <<< "$RULESET" 2>&1 | grep -v '# new generation' | drop_seconds)
Signature · 1 line
2.30.2
Phil Sutter
reviewerQuoted 17 lines · Pablo Neira Ayuso
Add seconds as expiration, otherwise 14m59 reports 14m in minute granularity, this ensures suficient time in a very slow environment with debugging instrumentation.
Fixes adf38fd84257 ("tests: shell: use minutes granularity in sets/0036add_set_element_expiration_0")Signed-off-by Pablo Neira Ayuso <[email protected]>---
I still see this failing occasionally due to timing issues, fix it.tests/shell/testcases/sets/0036add_set_element_expiration_0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/shell/testcases/sets/0036add_set_element_expiration_0 +0
-0
tests/shell/testcases/sets/0036add_set_element_expiration_0 drop_seconds() { · line 13
Quoted 7 lines
tests/shell/testcases/sets/0036add_set_element_expiration_0 +1
-1@@ -8,7 +8,7 @@ drop_seconds() { RULESET="add table ip x add set ip x y { type ipv4_addr; flags dynamic,timeout; } -add element ip x y { 1.1.1.1 timeout 30m expires 15m }" +add element ip x y { 1.1.1.1 timeout 30m expires 15m59s }" test_output=$($NFT -e -f - <<< "$RULESET" 2>&1 | grep -v '# new generation' | drop_seconds)
The next line in that file is:
| if [ "$test_output" != "$RULESET" ] ; then
You add "59s" to $RULESET and drop it from $test_output. I guess, to make it work, you also need to pipe $RULESET through drop_seconds before the comparison.
Cheers, Phil
Pablo Neira Ayuso
maintainerQuoted 28 lines · Phil Sutter
Quoted 17 lines · Pablo Neira Ayuso
Add seconds as expiration, otherwise 14m59 reports 14m in minute granularity, this ensures suficient time in a very slow environment with debugging instrumentation.
Fixes adf38fd84257 ("tests: shell: use minutes granularity in sets/0036add_set_element_expiration_0")Signed-off-by Pablo Neira Ayuso <[email protected]>---
I still see this failing occasionally due to timing issues, fix it.tests/shell/testcases/sets/0036add_set_element_expiration_0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/shell/testcases/sets/0036add_set_element_expiration_0 +0
-0tests/shell/testcases/sets/0036add_set_element_expiration_0 drop_seconds() { · line 13
Quoted 7 lines
tests/shell/testcases/sets/0036add_set_element_expiration_0 +1
-1@@ -8,7 +8,7 @@ drop_seconds() { RULESET="add table ip x add set ip x y { type ipv4_addr; flags dynamic,timeout; } -add element ip x y { 1.1.1.1 timeout 30m expires 15m }" +add element ip x y { 1.1.1.1 timeout 30m expires 15m59s }" test_output=$($NFT -e -f - <<< "$RULESET" 2>&1 | grep -v '# new generation' | drop_seconds)The next line in that file is:
Quoted 5 lines
| if [ "$test_output" != "$RULESET" ] ; then
You add "59s" to $RULESET and drop it from $test_output. I guess, to make it work, you also need to pipe $RULESET through
drop_secondsbefore the comparison.
Indeed, apologies: See latest patch.
https://patchwork.ozlabs.org/project/netfilter-devel/patch/[email protected]/
Pablo Neira Ayuso
maintainerQuoted 31 lines · Pablo Neira Ayuso
Quoted 30 lines · Phil Sutter
Quoted 17 lines · Pablo Neira Ayuso
Add seconds as expiration, otherwise 14m59 reports 14m in minute granularity, this ensures suficient time in a very slow environment with debugging instrumentation.
Fixes adf38fd84257 ("tests: shell: use minutes granularity in sets/0036add_set_element_expiration_0")Signed-off-by Pablo Neira Ayuso <[email protected]>---
I still see this failing occasionally due to timing issues, fix it.tests/shell/testcases/sets/0036add_set_element_expiration_0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/shell/testcases/sets/0036add_set_element_expiration_0 +0
-0tests/shell/testcases/sets/0036add_set_element_expiration_0 drop_seconds() { · line 13
Quoted 7 lines
tests/shell/testcases/sets/0036add_set_element_expiration_0 +1
-1@@ -8,7 +8,7 @@ drop_seconds() { RULESET="add table ip x add set ip x y { type ipv4_addr; flags dynamic,timeout; } -add element ip x y { 1.1.1.1 timeout 30m expires 15m }" +add element ip x y { 1.1.1.1 timeout 30m expires 15m59s }" test_output=$($NFT -e -f - <<< "$RULESET" 2>&1 | grep -v '# new generation' | drop_seconds)The next line in that file is:
| if [ "$test_output" != "$RULESET" ] ; then
Quoted 7 lines
Quoted 3 lines
You add "59s" to $RULESET and drop it from $test_output. I guess, to make it work, you also need to pipe $RULESET through
drop_secondsbefore the comparison.Indeed, apologies: See latest patch.
https://patchwork.ozlabs.org/project/netfilter-devel/patch/[email protected]/
Ouch, still fails. Damn, I don't get a proper fix for this script.
Florian Westphal
maintainerQuoted 3 lines · Pablo Neira Ayuso
Ouch, still fails. Damn, I don't get a proper fix for this script.
What about restoring an expire value of 3s, then check there is *one* element, wait 4s, check element is gone?
Tests are parallelized, so this won't cause noticeable slowdown.
Pablo Neira Ayuso
maintainerQuoted 9 lines · Florian Westphal
Quoted 3 lines · Pablo Neira Ayuso
Ouch, still fails. Damn, I don't get a proper fix for this script.
What about restoring an expire value of 3s, then check there is *one* element, wait 4s, check element is gone?
Tests are parallelized, so this won't cause noticeable slowdown.
:) I have been running tests for a while and it seems no more spurious errors show with:
https://patchwork.ozlabs.org/project/netfilter-devel/patch/[email protected]/
Not related, next one to look at is:
W: [DUMP FAIL] 31/378 testcases/sets/0062set_connlimit
which occasionally fails. This is because this adds an element:
table ip x {
set est-connlimit {
type ipv4_addr
size 65535
flags dynamic
elements = { 84.245.120.167 ct count over 20 }
}
}the conncount list is empty, then GC might win race to delete this element with no entries (GC removes empty conncount lists).
I added this test to make sure this restores fine, even if GC removes all elements that has been restored as soon as it gets a chance to run, because the conncount list is empty.
For this one, I can set a larger gc-interval, so GC takes longer time to release it, and still parser coverage for this restoration remains in place.