The following test reproduces it:
import reframe as rfm
import reframe.utility.sanity as sn
@rfm.simple_test
class buggy_test(rfm.RunOnlyRegressionTest):
valid_prog_environs = ['*']
valid_systems = ['*']
executable = 'echo'
x = variable(str)
@sanity_function
def validate(self):
return sn.assert_found(r'value', self.stdout)
@run_before('run')
def set_arg(self):
self.x = 'value'
self.set_var_default('x', 'default')
self.executable_opts = [self.x]
The problem comes from here:
https://github.com/reframe-hpc/reframe/blob/develop/reframe/core/pipeline.py#L1372
This check only checks if the variable was defined with a default value and does not cover the case when it was assigned a value after the test's instantiation. The check should be instead hasattr(self, var_name).