oar-team / batsim

Batsim: Infrastructure simulator for job and I/O scheduling
GNU Lesser General Public License v3.0
30 stars 15 forks source link

[test] add scheduler energywatcher in the tests #64

Closed Mema5 closed 3 years ago

Mema5 commented 3 years ago

I was investigating how energy accounting is working for multicore machines in Batsim and I saw this fixme in batsim tests. It says that the basched scheduler energywatcher needs to be fixed, which I did in this commit in my fork of batsched.

How to check that it works

Build my version of batsched:

$ cd /tmp/ && git clone https://framagit.org/Mema5/batsched.git
$ cd batsched/
$ git checkout fix_energy_watcher
$ nix-shell -A batsched # enter a Nix environment with all dependencies managed
$ meson build # generate a build directory
$ ninja -C build # compile the project into the build directory

In another terminal, in this branch of batsim:

$ nix-shell -A integration_tests # environment with master version of batsched
$ pytest test/test_energy.py # test does not pass
$ export PATH="/tmp/batsched/build:${PATH}" # use the version of batsched with the bugfix
$ which batsched # should answer /tmp/batsched/build/batsched
$ pytest test/test_energy.py # the test passes :)

Checklist

Branch name.

Branch content.

mpoquet commented 3 years ago

Merged in 3def174, thanks :).