Skip to content

Conversation

@teojgo
Copy link
Contributor

@teojgo teojgo commented Apr 10, 2020

  • Fix AttributeError raised when trying to mutate a SequenceView
    object in the filternodes method of the slurm scheduler.

  • Add a corresponding unittest.

Fixes #1258

* Fix `AttributeError` raised when trying to mutate a `SequenceView`
  object in the `filternodes` method of the slurm scheduler.

* Add a corresponding unittest.
Copy link
Contributor

@ekouts ekouts left a comment

Choose a reason for hiding this comment

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

lgtm in general. I only added a comment to change to f-strings, if possible.

@vkarak
Copy link
Contributor

vkarak commented Apr 14, 2020

@teojgo I can't understand where this SequenceView object comes from.

@codecov-io
Copy link

codecov-io commented Apr 14, 2020

Codecov Report

Merging #1259 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1259   +/-   ##
=======================================
  Coverage   91.39%   91.39%           
=======================================
  Files          84       84           
  Lines       12409    12416    +7     
=======================================
+ Hits        11341    11348    +7     
  Misses       1068     1068           
Impacted Files Coverage Δ
reframe/core/schedulers/slurm.py 53.51% <100.00%> (ø)
unittests/test_schedulers.py 95.43% <100.00%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e167d8d...0556a10. Read the comment docs.

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 would just do the fix here and not any conversion to f-strings. it's two lines only + the comment. In your initial version, it made sense to change to f-strings the lines you were touching, but now you need not touch them for your fix.

@vkarak
Copy link
Contributor

vkarak commented Apr 14, 2020

It seems that this unit test is not enough. It does not break if you revert the fix. Since I'm fixing the PR, I will have a look at it as well.

@teojgo
Copy link
Contributor Author

teojgo commented Apr 14, 2020

It seems that this unit test is not enough. It does not break if you revert the fix. Since I'm fixing the PR, I will have a look at it as well.

@varak yes, that's why I had the separate unit test because you need both self.testjob._sched_access and one of the other self.test_job._sched... in order to try to mutate the SequenceView.

@vkarak
Copy link
Contributor

vkarak commented Apr 14, 2020

@teojgo Yes, just realized that. I will cherry pick that commit.

@vkarak vkarak force-pushed the bugfix/slurm_filter_nodes branch from 933f2d5 to 873d100 Compare April 14, 2020 11:28
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.

lgtm now

@vkarak vkarak changed the title [bugfix] Fix 'AttributeError' in 'filternodes'of slurm scheduler [bugfix] Fix AttributeError in flexible node allocation from the Slurm backend Apr 14, 2020
@vkarak vkarak merged commit 106a774 into reframe-hpc:master Apr 14, 2020
@teojgo teojgo deleted the bugfix/slurm_filter_nodes branch May 12, 2020 14:31
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.

AttributeError is raised in 'filternodes' method of slurm scheduler

4 participants