malloc: Run tst-malloc-stats-cancellation via test-driver.c

Message ID 20210406223947.GA39160@aloka.lostca.se
State Committed
Commit 0a282de11b87fb4ad015c0cd10158555999705f9
Headers
Series malloc: Run tst-malloc-stats-cancellation via test-driver.c |

Commit Message

Arjun Shankar April 6, 2021, 10:39 p.m. UTC
  From: Arjun Shankar <arjun@redhat.com>

This allows the test to time out in case it hangs.
---
I ran into an instance of this test hanging when building glibc on Fedora
Rawhide for armv7hl.  I am still investigating the cause of that but, in
the meanwhile, this change is still worth making.

 malloc/tst-malloc-stats-cancellation.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
  

Comments

Carlos O'Donell April 7, 2021, 12:21 a.m. UTC | #1
On 4/6/21 6:39 PM, Arjun Shankar wrote:
> From: Arjun Shankar <arjun@redhat.com>
> 
> This allows the test to time out in case it hangs.
> ---
> I ran into an instance of this test hanging when building glibc on Fedora
> Rawhide for armv7hl.  I am still investigating the cause of that but, in
> the meanwhile, this change is still worth making.
> 

LGTM.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

>  malloc/tst-malloc-stats-cancellation.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/malloc/tst-malloc-stats-cancellation.c b/malloc/tst-malloc-stats-cancellation.c
> index 9a8f475830..725cad6498 100644
> --- a/malloc/tst-malloc-stats-cancellation.c
> +++ b/malloc/tst-malloc-stats-cancellation.c
> @@ -91,8 +91,8 @@ buffer_threadproc (void *argp)
>  }
>  
>  
> -int
> -main (void)
> +static int
> +do_test (void)
>  {
>    int result = 0, err, real_stderr_fd, bufpipe[2];
>    pthread_t t_thr, b_thr;
> @@ -214,3 +214,5 @@ main (void)
>      }
>    return result;
>  }
> +
> +#include <support/test-driver.c>
>
  

Patch

diff --git a/malloc/tst-malloc-stats-cancellation.c b/malloc/tst-malloc-stats-cancellation.c
index 9a8f475830..725cad6498 100644
--- a/malloc/tst-malloc-stats-cancellation.c
+++ b/malloc/tst-malloc-stats-cancellation.c
@@ -91,8 +91,8 @@  buffer_threadproc (void *argp)
 }
 
 
-int
-main (void)
+static int
+do_test (void)
 {
   int result = 0, err, real_stderr_fd, bufpipe[2];
   pthread_t t_thr, b_thr;
@@ -214,3 +214,5 @@  main (void)
     }
   return result;
 }
+
+#include <support/test-driver.c>