forked from linux-test-project/ltp
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: redefine the overall timeout logic of test
This patch revises the logic for managing test timeout and runtime limits, introducing a more structured approach. The key changes include renaming max_runtime to runtime for clarity and adding overall_time to represent the total time limit for a test. This ensures better separation of test phases (setup, execution, and cleanup) and clearer timeout management. Key Concepts: timeout: Defines the maximum time allowed for the entire test, including setup, execution, and cleanup, when no explicit runtime is set. But if a runtime is explicitly defined and tst_remaining_runtime() is used, the timeout applies only to the setup and cleanup phases, as the runtime controls the test execution duration. runtime: The maximum runtime of the test's main execution loop, used in tests that call tst_remaining_runtime(). It ensures the main execution runs for a fixed duration, regardless of kernel configuration (e.g., debug kernel). Overall timeout is structured as follows: | -- (default_30s + timeout) * timeout_mul -- | -- runtime * runtime_mul -- | And, the TST_UNLIMITED_RUNTIME constant has been deprecated and replaced by TST_UNLIMITED_TIMEOUT. This change simplifies the handling of unlimited execution scenarios while aligning the terminology with the new timeout model. Suggested-by: Cyril Hrubis <[email protected]> Signed-off-by: Li Wang <[email protected]> Reviewed-by: Cyril Hrubis <[email protected]> Reviewed-by: Petr Vorel <[email protected]>
- Loading branch information
1 parent
082f096
commit a6a369c
Showing
94 changed files
with
219 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,5 +24,5 @@ static void run(void) | |
|
||
static struct tst_test test = { | ||
.test_all = run, | ||
.max_runtime = 5, | ||
.runtime = 5, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.