Skip to content

Conversation

@synscc
Copy link
Contributor

@synscc synscc commented Mar 26, 2022

When a modulecmd python load fails with a module file, the frame's code context being None causes reframe to terminate prematurely.

SUMMARY OF FAILURES
/home/chungsy/projects/reframe.git/bin/reframe: run session stopped: type error: can only join an iterable
/home/chungsy/projects/reframe.git/bin/reframe: Traceback (most recent call last):
  File "/home/chungsy/projects/reframe.git/reframe/frontend/cli.py", line 1210, in main
    runner.stats.print_failure_report(printer)
  File "/home/chungsy/projects/reframe.git/reframe/frontend/statistics.py", line 210, in print_failure_report
    run_report = self.json()[-1]
  File "/home/chungsy/projects/reframe.git/reframe/frontend/statistics.py", line 164, in json
    entry['fail_reason'] = errors.what(*t.exc_info)
  File "/home/chungsy/projects/reframe.git/reframe/core/exceptions.py", line 370, in what
    source = ''.join(frame.code_context)
TypeError: can only join an iterable

After this patch, it's able to continue the normal error reporting process.

FAILURE INFO for GromacsTest_0
  * Expanded name: GromacsTest %pi=0
  * Description: GromacsTest %pi=0
  * System partition: cex:vanilla-mpi
  * Environment: builtin
  * Stage directory: /home/chungsy/projects/nscc-reframe-tests.git/stage/cex/vanilla-mpi/builtin/GromacsTest_0
  * Node list:
  * Job type: batch job (id=None)
  * Dependencies (conceptual): []
  * Dependencies (actual): []
  * Maintainers: []
  * Failing phase: run
  * Rerun with '-n GromacsTest_0 -p builtin --system cex:vanilla-mpi -r'
  * Reason: name error: <string>:32: name 'source' is not defined

The 'source' is actually a BASH source command included in a module file.

@jenkins-cscs
Copy link
Collaborator

Can I test this patch?

@vkarak vkarak self-requested a review March 27, 2022 18:19
@vkarak vkarak added this to the ReFrame Sprint 22.03.2 milestone Mar 27, 2022
@vkarak vkarak changed the title Fix TypeError in user error description. [bugfix] Fix TypeError in user error description Mar 28, 2022
Copy link
Contributor

@vkarak vkarak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have just a minor suggestion.

@vkarak vkarak changed the title [bugfix] Fix TypeError in user error description [bugfix] Treat empty source code context where reporting errors Mar 29, 2022
@vkarak vkarak changed the title [bugfix] Treat empty source code context where reporting errors [bugfix] Treat empty source code context when reporting errors Mar 29, 2022
@vkarak vkarak merged commit cd07b81 into reframe-hpc:master Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants