Skip to content

Commit 8fb37b7

Browse files
wangli5665acerv
authored andcommitted
ltp: don't override LTP_TIMEOUT_MUL if set by user
The Kirk framework was unconditionally calculating and setting the LTP_TIMEOUT_MUL env variable based on the test_timeout parameter, overriding any value that the user might have set beforehand. This change ensures that if the LTP_TIMEOUT_MUL environment variable is already set in the environment, the framework will not override it. This allows users to explicitly control the timeout multiplier for LTP tests. The automatic calculation based on test_timeout remains as a fallback when LTP_TIMEOUT_MUL is not set by the user. Signed-off-by: Li Wang <liwang@redhat.com>
1 parent 7a87ada commit 8fb37b7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

libkirk/ltp.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ def setup(self, **kwargs: Dict[str, Any]) -> None:
6464
self._env.update(env)
6565

6666
timeout = libkirk.types.dict_item(kwargs, "test_timeout", float)
67-
if timeout:
67+
user_timeout_mul = os.environ.get("LTP_TIMEOUT_MUL")
68+
if timeout and not user_timeout_mul:
6869
self._env["LTP_TIMEOUT_MUL"] = str((timeout * 0.9) / 300.0)
6970

7071
root = libkirk.types.dict_item(kwargs, "root", str)

0 commit comments

Comments
 (0)