diff mbox series

Report error if setaffinity wrapper fails (Bug 32040)

Message ID 20240815122756.260740-1-carlos@redhat.com
State New
Headers show
Series Report error if setaffinity wrapper fails (Bug 32040) | expand

Commit Message

Carlos O'Donell Aug. 15, 2024, 12:27 p.m. UTC
Previously if the setaffinity wrapper failed the rest of the subtest
would not execute and the current subtest would be reported as passing.
Now if the setaffinity wrapper fails the subtest is correctly reported
as faling. Tested manually by changing the conditions of the affinity
call including setting size to zero, or checking the wrong condition.

No regressions on x86_64.
---
 sysdeps/unix/sysv/linux/tst-skeleton-affinity.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Florian Weimer Aug. 15, 2024, 12:46 p.m. UTC | #1
* Carlos O'Donell:

> Previously if the setaffinity wrapper failed the rest of the subtest
> would not execute and the current subtest would be reported as passing.
> Now if the setaffinity wrapper fails the subtest is correctly reported
> as faling. Tested manually by changing the conditions of the affinity
> call including setting size to zero, or checking the wrong condition.
>
> No regressions on x86_64.
> ---
>  sysdeps/unix/sysv/linux/tst-skeleton-affinity.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sysdeps/unix/sysv/linux/tst-skeleton-affinity.c b/sysdeps/unix/sysv/linux/tst-skeleton-affinity.c
> index 31a15b3ad7..2f921ed397 100644
> --- a/sysdeps/unix/sysv/linux/tst-skeleton-affinity.c
> +++ b/sysdeps/unix/sysv/linux/tst-skeleton-affinity.c
> @@ -157,7 +157,7 @@ test_size (const struct conf *conf, size_t size)
>    if (setaffinity (kernel_size, initial_set) < 0)
>      {
>        printf ("error: size %zu: setaffinity: %m\n", size);
> -      return true;
> +      return false;
>      }
>  
>    /* Use one-CPU set to test switching between CPUs.  */

Maybe the intent was to use something like FAIL_UNSUPPORTED originally,
but I think we can make the change you suggest and see if it leads to
additional container environment failures.

Reviewed-by: Florian Weimer <fweimer@redhat.com>

Thanks,
Florian
Carlos O'Donell Aug. 15, 2024, 7:31 p.m. UTC | #2
On 8/15/24 8:46 AM, Florian Weimer wrote:
> * Carlos O'Donell:
> 
>> Previously if the setaffinity wrapper failed the rest of the subtest
>> would not execute and the current subtest would be reported as passing.
>> Now if the setaffinity wrapper fails the subtest is correctly reported
>> as faling. Tested manually by changing the conditions of the affinity
>> call including setting size to zero, or checking the wrong condition.
>>
>> No regressions on x86_64.
>> ---
>>  sysdeps/unix/sysv/linux/tst-skeleton-affinity.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/sysdeps/unix/sysv/linux/tst-skeleton-affinity.c b/sysdeps/unix/sysv/linux/tst-skeleton-affinity.c
>> index 31a15b3ad7..2f921ed397 100644
>> --- a/sysdeps/unix/sysv/linux/tst-skeleton-affinity.c
>> +++ b/sysdeps/unix/sysv/linux/tst-skeleton-affinity.c
>> @@ -157,7 +157,7 @@ test_size (const struct conf *conf, size_t size)
>>    if (setaffinity (kernel_size, initial_set) < 0)
>>      {
>>        printf ("error: size %zu: setaffinity: %m\n", size);
>> -      return true;
>> +      return false;
>>      }
>>  
>>    /* Use one-CPU set to test switching between CPUs.  */
> 
> Maybe the intent was to use something like FAIL_UNSUPPORTED originally,
> but I think we can make the change you suggest and see if it leads to
> additional container environment failures.

Yes, I was thinking the same thing when I saw the getaffinity/setaffinity pair.

The pre-commit CI systems didn't fail so it seems to work to do both pairs.

> Reviewed-by: Florian Weimer <fweimer@redhat.com>

Thanks!
diff mbox series

Patch

diff --git a/sysdeps/unix/sysv/linux/tst-skeleton-affinity.c b/sysdeps/unix/sysv/linux/tst-skeleton-affinity.c
index 31a15b3ad7..2f921ed397 100644
--- a/sysdeps/unix/sysv/linux/tst-skeleton-affinity.c
+++ b/sysdeps/unix/sysv/linux/tst-skeleton-affinity.c
@@ -157,7 +157,7 @@  test_size (const struct conf *conf, size_t size)
   if (setaffinity (kernel_size, initial_set) < 0)
     {
       printf ("error: size %zu: setaffinity: %m\n", size);
-      return true;
+      return false;
     }
 
   /* Use one-CPU set to test switching between CPUs.  */