From 0ae749f5af6d156732b3b9531e2071f6a979a4cf Mon Sep 17 00:00:00 2001 From: casparvl Date: Fri, 10 Jul 2026 14:51:41 +0000 Subject: [PATCH] Small optimization: we don't need to load the ReFrame programming environment if the entry is already in the module cache --- eessi/testsuite/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eessi/testsuite/utils.py b/eessi/testsuite/utils.py index ff551947..95d92a2d 100644 --- a/eessi/testsuite/utils.py +++ b/eessi/testsuite/utils.py @@ -174,12 +174,12 @@ def _is_valid_for_env(mod, env): if part.fullname not in _modules_cache: _modules_cache[part.fullname] = {} for env in part.environs: - rt.loadenv(part.local_env, env) if env.name not in _modules_cache[part.fullname]: log(f'Getting available modules for ({part.fullname}, {env.name})') + rt.loadenv(part.local_env, env) available_modules = sorted(ms.available_modules()) _modules_cache[part.fullname][env.name] = [mod for mod in available_modules if not mod.endswith('/')] - snap0.restore() + snap0.restore() seen = set() dupes = [] for mod in _modules_cache[part.fullname][env.name]: