mirror of
https://github.com/torvalds/linux.git
synced 2025-08-15 14:11:42 +02:00

Currently, the in-kernel kunit test case timeout is 300 seconds. (There is a separate timeout mechanism for the whole test execution in kunit.py, but that's unrelated.) However, tests marked 'slow' or 'very slow' may timeout, particularly on slower machines. Implement a multiplier to the test-case timeout, so that slower tests have longer to complete: - DEFAULT -> 1x default timeout - KUNIT_SPEED_SLOW -> 3x default timeout - KUNIT_SPEED_VERY_SLOW -> 12x default timeout A further change is planned to allow user configuration of the default/base timeout to allow people with faster or slower machines to adjust these to their use-cases. Link: https://lore.kernel.org/r/20250614084711.2654593-2-davidgow@google.com Signed-off-by: Ujwal Jain <ujwaljain@google.com> Co-developed-by: David Gow <davidgow@google.com> Signed-off-by: David Gow <davidgow@google.com> Reviewed-by: Rae Moar <rmoar@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
29 lines
687 B
C++
29 lines
687 B
C++
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Internal kunit try catch implementation to be shared with tests.
|
|
*
|
|
* Copyright (C) 2019, Google LLC.
|
|
* Author: Brendan Higgins <brendanhiggins@google.com>
|
|
*/
|
|
|
|
#ifndef _KUNIT_TRY_CATCH_IMPL_H
|
|
#define _KUNIT_TRY_CATCH_IMPL_H
|
|
|
|
#include <kunit/try-catch.h>
|
|
#include <linux/types.h>
|
|
|
|
struct kunit;
|
|
|
|
static inline void kunit_try_catch_init(struct kunit_try_catch *try_catch,
|
|
struct kunit *test,
|
|
kunit_try_catch_func_t try,
|
|
kunit_try_catch_func_t catch,
|
|
unsigned long timeout)
|
|
{
|
|
try_catch->test = test;
|
|
try_catch->try = try;
|
|
try_catch->catch = catch;
|
|
try_catch->timeout = timeout;
|
|
}
|
|
|
|
#endif /* _KUNIT_TRY_CATCH_IMPL_H */
|