diff mbox series

check: wipe tmp.arglist

Message ID 20221214215926.908628-1-leah.rumancik@gmail.com (mailing list archive)
State New, archived
Headers show
Series check: wipe tmp.arglist | expand

Commit Message

Leah Rumancik Dec. 14, 2022, 9:59 p.m. UTC
Make sure tmp.arglist is wiped before each run to avoid
accidentally rerunning tests.

Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
---
 check | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Disseldorp Dec. 15, 2022, 11:36 a.m. UTC | #1
Hi Leah,

On Wed, 14 Dec 2022 13:59:26 -0800, Leah Rumancik wrote:

> Make sure tmp.arglist is wiped before each run to avoid
> accidentally rerunning tests.
> 
> Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
> ---
>  check | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/check b/check
> index d2e51296..81a30928 100755
> --- a/check
> +++ b/check
> @@ -46,7 +46,7 @@ export DIFF_LENGTH=${DIFF_LENGTH:=10}
>  # by default don't output timestamps
>  timestamp=${TIMESTAMP:=false}
>  
> -rm -f $tmp.list $tmp.tmp $tmp.grep $here/$iam.out $tmp.xlist $tmp.report.*
> +rm -f $tmp.list $tmp.tmp $tmp.grep $here/$iam.out $tmp.xlist $tmp.report.* $tmp.arglist
>  
>  SRC_GROUPS="generic shared"
>  export SRC_DIR="tests"

I can't quite see how "accidental rerun" can happen, given that
_summary()/_wrapup() should remove any $tmp.arglist on completion,
and a PID collision for $tmp would also be needed. That said, it still
probably makes sense to be consistent with the other files here, so:

Reviewed-by: David Disseldorp <ddiss@suse.de>
Darrick J. Wong Dec. 15, 2022, 4:10 p.m. UTC | #2
On Wed, Dec 14, 2022 at 01:59:26PM -0800, Leah Rumancik wrote:
> Make sure tmp.arglist is wiped before each run to avoid
> accidentally rerunning tests.
> 
> Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>

Makes sense to me, though it might help to put the exact sequence of
brokenness in the commit message since (like David) I wondered why the
_summary and _wrapup functions wouldn't zap $tmp.arglist.

Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  check | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/check b/check
> index d2e51296..81a30928 100755
> --- a/check
> +++ b/check
> @@ -46,7 +46,7 @@ export DIFF_LENGTH=${DIFF_LENGTH:=10}
>  # by default don't output timestamps
>  timestamp=${TIMESTAMP:=false}
>  
> -rm -f $tmp.list $tmp.tmp $tmp.grep $here/$iam.out $tmp.xlist $tmp.report.*
> +rm -f $tmp.list $tmp.tmp $tmp.grep $here/$iam.out $tmp.xlist $tmp.report.* $tmp.arglist
>  
>  SRC_GROUPS="generic shared"
>  export SRC_DIR="tests"
> -- 
> 2.39.0.314.g84b9a713c41-goog
>
Leah Rumancik Dec. 19, 2022, 7:03 p.m. UTC | #3
Oops, I originally ran into this when I was testing using /var/tmp
instead of /tmp [1], but since we aren't going this route anymore, 
I don't need this for my use case. I am attempting to auto-recover when
a test crashes and relaunch the remaining tests and I was seeing some
tests being rerun due to the lingering tmp.arglist file.

This could occur on the off chance someone's /tmp is persistent or if
there wasn't a clean shutdown, maybe via an OOM kill? Perhaps it is
worth including for consistency's sake. I can update the commit
description if we want to keep it. Let me know your thoughts.

- Leah

[1] https://lore.kernel.org/fstests/20221212230646.4022294-1-leah.rumancik@gmail.com/
diff mbox series

Patch

diff --git a/check b/check
index d2e51296..81a30928 100755
--- a/check
+++ b/check
@@ -46,7 +46,7 @@  export DIFF_LENGTH=${DIFF_LENGTH:=10}
 # by default don't output timestamps
 timestamp=${TIMESTAMP:=false}
 
-rm -f $tmp.list $tmp.tmp $tmp.grep $here/$iam.out $tmp.xlist $tmp.report.*
+rm -f $tmp.list $tmp.tmp $tmp.grep $here/$iam.out $tmp.xlist $tmp.report.* $tmp.arglist
 
 SRC_GROUPS="generic shared"
 export SRC_DIR="tests"