Skip to contentSkip to conversation

tests: shell: Fix for unstable sets/0043concatenated_ranges_0

PATCH In review Phil Sutter 3 participants 4 messages Apr 20, 2023 netfilter

lore
Share & tools
lore

Phil Sutter

author reviewer
#0 lore raw

PATCH 1/1 tests: shell: Fix for unstable sets/0043concatenated_ranges_0

On my (slow?) testing VM, The test tends to fail when doing a full run (i.e., calling run-test.sh without arguments) and tends to pass when run individually.

The problem seems to be the 1s element timeout which in some cases may pass before element deletion occurs. Simply fix this by doubling the timeout. It has to pass just once, so shouldn't hurt too much.

Fixes 618393c6b3f25 ("tests: Introduce test for set with concatenated ranges")
Cc Stefano Brivio <[email protected]>
---
 tests/shell/testcases/sets/0043concatenated_ranges_0 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/shell/testcases/sets/0043concatenated_ranges_0 +2 -2
index 11767373bcd22..6e8f4000aa4ef 100755
@@ -147,7 +147,7 @@ for ta in ${TYPES}; do
 			eval add_b=\$ADD_${tb}
 			eval add_c=\$ADD_${tc}
 			${NFT} add element inet filter test \
-				"{ ${add_a} . ${add_b} . ${add_c} timeout 1s${mapv}}"
+				"{ ${add_a} . ${add_b} . ${add_c} timeout 2s${mapv}}"
 			[ $(${NFT} list ${setmap} inet filter test |	\
 			   grep -c "${add_a} . ${add_b} . ${add_c}") -eq 1 ]
 
@@ -180,7 +180,7 @@ for ta in ${TYPES}; do
 				continue
 			fi
 
-			sleep 1
+			sleep 2
 			[ $(${NFT} list ${setmap} inet filter test |		\
 			   grep -c "${add_a} . ${add_b} . ${add_c} ${mapv}") -eq 0 ]
 			timeout_tested=1
Signature · 1 line
2.40.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · On Thu, 20 Apr 2023 17:47:23 +0200 Phil Sutter <[email protected]> wrote:

On my (slow?) testing VM, The test tends to fail when doing a full run (i.e., calling run-test.sh without arguments) and tends to pass when run individually.

The problem seems to be the 1s element timeout which in some cases may pass before element deletion occurs.

Whoops. Yes I think so too.

Quoted 6 lines

Simply fix this by doubling the
timeout. It has to pass just once, so shouldn't hurt too much.

Fixes 618393c6b3f25 ("tests: Introduce test for set with concatenated ranges")
Cc Stefano Brivio <[email protected]>
Signature · 1 line
Stefano
#2 lore raw
In reply to Phil Sutter
Quoted 7 lines · Phil Sutter

On my (slow?) testing VM, The test tends to fail when doing a full run (i.e., calling run-test.sh without arguments) and tends to pass when run individually.

The problem seems to be the 1s element timeout which in some cases may pass before element deletion occurs. Simply fix this by doubling the timeout. It has to pass just once, so shouldn't hurt too much.

I have seen this with CONFIG_KASAN too, thanks Phil.

Quoted 32 lines
Fixes 618393c6b3f25 ("tests: Introduce test for set with concatenated ranges")
Cc Stefano Brivio <[email protected]>
---
 tests/shell/testcases/sets/0043concatenated_ranges_0 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/shell/testcases/sets/0043concatenated_ranges_0 +2 -2
index 11767373bcd22..6e8f4000aa4ef 100755
@@ -147,7 +147,7 @@ for ta in ${TYPES}; do
 			eval add_b=\$ADD_${tb}
 			eval add_c=\$ADD_${tc}
 			${NFT} add element inet filter test \
-				"{ ${add_a} . ${add_b} . ${add_c} timeout 1s${mapv}}"
+				"{ ${add_a} . ${add_b} . ${add_c} timeout 2s${mapv}}"
 			[ $(${NFT} list ${setmap} inet filter test |	\
 			   grep -c "${add_a} . ${add_b} . ${add_c}") -eq 1 ]
 
@@ -180,7 +180,7 @@ for ta in ${TYPES}; do
 				continue
 			fi
 
-			sleep 1
+			sleep 2
 			[ $(${NFT} list ${setmap} inet filter test |		\
 			   grep -c "${add_a} . ${add_b} . ${add_c} ${mapv}") -eq 0 ]
 			timeout_tested=1
Signature · 1 line
2.40.0
author reviewer
#3 lore raw
In reply to Phil Sutter
Quoted 11 lines · Phil Sutter

On my (slow?) testing VM, The test tends to fail when doing a full run (i.e., calling run-test.sh without arguments) and tends to pass when run individually.

The problem seems to be the 1s element timeout which in some cases may pass before element deletion occurs. Simply fix this by doubling the timeout. It has to pass just once, so shouldn't hurt too much.

Fixes 618393c6b3f25 ("tests: Introduce test for set with concatenated ranges")
Cc Stefano Brivio <[email protected]>

Patch applied.