public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] [gdb/testsuite] Use gdb_remote_download in allow_opencl_tests
@ 2023-03-14 16:17 Tom de Vries
  2023-03-23 13:56 ` [committed] " Tom de Vries
  0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2023-03-14 16:17 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

Simon reported that doing:
...
$ while make check-parallel TESTS='gdb.opencl/*.exp' -j 100; do true; done
...
could run into:
...
ERROR: remote_download to target of \
  /data/vries/gdb/src/gdb/testsuite/lib/opencl_kernel.cl to opencl_kernel.cl: \
  cp: cannot create regular file 'opencl_kernel.cl': File exists
...

Fix this by using gdb_remote_download (instead of plain remote_download) in
allow_opencl_test, which takes care of:
- downloading to a location which is safe for parallel testing, by
  using standard_output_file, and
- cleaning up the downloaded file, meaning we can remove the corresponding
  "remote_file target delete ${clprogram}" lines in allow_opencl_test.

Tested on x86_64-linux.

Reported-by: Simon Marchi <simon.marchi@efficios.com>
---
 gdb/testsuite/lib/opencl.exp | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/gdb/testsuite/lib/opencl.exp b/gdb/testsuite/lib/opencl.exp
index dc7966443d5..e878c4e87ae 100644
--- a/gdb/testsuite/lib/opencl.exp
+++ b/gdb/testsuite/lib/opencl.exp
@@ -38,14 +38,13 @@ gdb_caching_proc allow_opencl_tests {} {
     # Set up, compile, and execute an OpenCL program.  Include the current
     # process ID in the file name of the executable to prevent conflicts with
     # invocations for multiple testsuites.
-    set clprogram [remote_download target ${srcdir}/lib/opencl_kernel.cl]
+    set clprogram [gdb_remote_download target ${srcdir}/lib/opencl_kernel.cl]
     set executable opencltest[pid].x
 
     verbose "$me:  compiling OpenCL test app" 2
     set compile_flags {debug nowarnings quiet}
 
     if { [gdb_compile_opencl_hostapp "${clprogram}" "${executable}" "${compile_flags}" ] != "" } {
-	remote_file target delete ${clprogram}
 	verbose "$me:  compiling OpenCL binary failed, returning 0" 2
 	return 0
     }
@@ -70,9 +69,6 @@ gdb_caching_proc allow_opencl_tests {} {
     gdb_exit
     remote_file build delete $executable
 
-    # Delete the OpenCL program source file.
-    remote_file target delete ${clprogram}
-
     verbose "$me:  returning $result" 2
     return $result
 }

base-commit: 8900a92ead1c4f94216b95eb5f76aafdf74a94a0
-- 
2.35.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [committed] [gdb/testsuite] Use gdb_remote_download in allow_opencl_tests
  2023-03-14 16:17 [PATCH] [gdb/testsuite] Use gdb_remote_download in allow_opencl_tests Tom de Vries
@ 2023-03-23 13:56 ` Tom de Vries
  0 siblings, 0 replies; 2+ messages in thread
From: Tom de Vries @ 2023-03-23 13:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

On 3/14/23 17:17, Tom de Vries via Gdb-patches wrote:
> Simon reported that doing:
> ...
> $ while make check-parallel TESTS='gdb.opencl/*.exp' -j 100; do true; done
> ...
> could run into:
> ...
> ERROR: remote_download to target of \
>    /data/vries/gdb/src/gdb/testsuite/lib/opencl_kernel.cl to opencl_kernel.cl: \
>    cp: cannot create regular file 'opencl_kernel.cl': File exists
> ...
> 
> Fix this by using gdb_remote_download (instead of plain remote_download) in
> allow_opencl_test, which takes care of:
> - downloading to a location which is safe for parallel testing, by
>    using standard_output_file, and
> - cleaning up the downloaded file, meaning we can remove the corresponding
>    "remote_file target delete ${clprogram}" lines in allow_opencl_test.
> 
> Tested on x86_64-linux.
> 

Committed.

Thanks,
- Tom

> Reported-by: Simon Marchi <simon.marchi@efficios.com>
> ---
>   gdb/testsuite/lib/opencl.exp | 6 +-----
>   1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/gdb/testsuite/lib/opencl.exp b/gdb/testsuite/lib/opencl.exp
> index dc7966443d5..e878c4e87ae 100644
> --- a/gdb/testsuite/lib/opencl.exp
> +++ b/gdb/testsuite/lib/opencl.exp
> @@ -38,14 +38,13 @@ gdb_caching_proc allow_opencl_tests {} {
>       # Set up, compile, and execute an OpenCL program.  Include the current
>       # process ID in the file name of the executable to prevent conflicts with
>       # invocations for multiple testsuites.
> -    set clprogram [remote_download target ${srcdir}/lib/opencl_kernel.cl]
> +    set clprogram [gdb_remote_download target ${srcdir}/lib/opencl_kernel.cl]
>       set executable opencltest[pid].x
>   
>       verbose "$me:  compiling OpenCL test app" 2
>       set compile_flags {debug nowarnings quiet}
>   
>       if { [gdb_compile_opencl_hostapp "${clprogram}" "${executable}" "${compile_flags}" ] != "" } {
> -	remote_file target delete ${clprogram}
>   	verbose "$me:  compiling OpenCL binary failed, returning 0" 2
>   	return 0
>       }
> @@ -70,9 +69,6 @@ gdb_caching_proc allow_opencl_tests {} {
>       gdb_exit
>       remote_file build delete $executable
>   
> -    # Delete the OpenCL program source file.
> -    remote_file target delete ${clprogram}
> -
>       verbose "$me:  returning $result" 2
>       return $result
>   }
> 
> base-commit: 8900a92ead1c4f94216b95eb5f76aafdf74a94a0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-23 13:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-14 16:17 [PATCH] [gdb/testsuite] Use gdb_remote_download in allow_opencl_tests Tom de Vries
2023-03-23 13:56 ` [committed] " Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).