Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gdb/testsuite/gdb.rocm/names.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ int
main (int argc, char **argv)
{
/* So that the GPU threads don't spin forever. */
gdb_watchdog (30);
gdb_watchdog (90);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should that be dynamically set based on the testsuite's timeout so only one setting controls both?

diff --git a/gdb/testsuite/gdb.rocm/names.cpp b/gdb/testsuite/gdb.rocm/names.cpp
index f62dd295bf6..5ffa458c1da 100644
--- a/gdb/testsuite/gdb.rocm/names.cpp
+++ b/gdb/testsuite/gdb.rocm/names.cpp
@@ -209,7 +209,7 @@ int
 main (int argc, char **argv)
 {
   /* So that the GPU threads don't spin forever.  */
-  gdb_watchdog (30);
+  gdb_watchdog (TIMEOUT);
 
   if (argc != 2)
     {
diff --git a/gdb/testsuite/gdb.rocm/names.exp b/gdb/testsuite/gdb.rocm/names.exp
index ff734c32e97..d832a954b28 100644
--- a/gdb/testsuite/gdb.rocm/names.exp
+++ b/gdb/testsuite/gdb.rocm/names.exp
@@ -21,7 +21,8 @@ require allow_hipcc_tests
 
 standard_testfile .cpp
 
-if {[build_executable "failed to prepare" $testfile $srcfile {debug hip}]} {
+set options { "additional_flags=-DTIMEOUT=$timeout" debug hip }
+if {[build_executable "failed to prepare" $testfile $srcfile $options]} {
     return
 }

Do not have to be exactly TCL's timeout, but could be based on it (but I guess this value would be as good as any).

WDYT?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passer-by comment. I see these other tests also invoke the same:

gdb.rocm/mi-attach.cpp: gdb_watchdog (30);
gdb.rocm/detach-while-breakpoints-inserted.cpp: gdb_watchdog (30);
gdb.rocm/runtime-core.cpp: gdb_watchdog (30);
gdb.rocm/names.cpp: gdb_watchdog (30);
gdb.rocm/lane-info.cpp: gdb_watchdog (30);
gdb.rocm/device-interrupt.cpp: gdb_watchdog (10);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will complicate manual compilation. I think, this timeout should be the worst possible case, it happens only if something goes wrong and the value doesn't affect the execution time. It's OK to wait an extra minute if something goes wrong.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if that is a concern, the pattern could be to have

#ifndef TIMEOUT
#define TIMEOUT 30
#endif

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only problem is that we now have to figure out if we are running on the emulator in .exp script and adjust the TIMEOUT. It's getting too complicated for no reason, I guess.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is (as far as I know) already standard practice to bump the timeout using the site.exp file on environments where this is necessary. Such change would make it so that only local setting would also impact how long it takes before raising SIGALRM.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and I guess, if one wants to run the test manually (outside of the test framework), it could make more sense to have

#ifdef TIMEOUT
  gdb_watchdog (TIMEOUT);
#endif

that way, manually building and running things would completely remove the timeout (useful when we are debugging GDB itself).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I'll review the other tests and add necessary code.


if (argc != 2)
{
Expand Down
Loading