Commit 1713870a authored by MOMMESSIN Clement's avatar MOMMESSIN Clement

[tests] Fix tests for dynamic registration

parent 8dccd970
......@@ -211,7 +211,7 @@ class Batsim(object):
self._events_to_send.append(msg)
if not workload_name in self.profiles:
self.profiles[workload_name] = {}
self.logger.debug("A new dynamic workload of name {} has been received".format(workload_name))
self.logger.debug("A new dynamic workload of name '{}' has been created".format(workload_name))
self.logger.debug("Registering profile: {}".format(msg["data"]))
self.profiles[workload_name][profile_name] = profile
......
......@@ -225,13 +225,16 @@ class JobDescription:
scheduler._batsim.register_profiles(
self.workload.name,
additional_profiles)
{self.profile.name : self.profile.to_dict()})
scheduler._batsim.register_job(
str(self.id),
self.res,
self.walltime,
self.workload.name+'!'+self.profile.name,
self.profile.name,
self.subtime)
scheduler._batsim.register_profiles(
self.workload.name,
additional_profiles)
self._submitted = True
# Keep track of the workload object in the scheduler to relate job
......
......@@ -19,23 +19,22 @@ class DynamicTestScheduler(Scheduler):
res=2,
id=42,
profile=Profiles.Delay(7))
self.register_dynamic_job(walltime=10, res=2, profile=Profiles.Delay(7))
self.register_dynamic_job(walltime=10, res=2, profile=Profiles.Delay(7))
self.register_dynamic_job(walltime=10, res=2, profile=Profiles.Delay(5))
self.register_dynamic_job(walltime=10, res=2, profile=Profiles.Delay(6))
w = WorkloadDescription(name="TestWorkload")
w.new_job(subtime=0, walltime=10, res=4, profile=Profiles.Delay(5))
w.new_job(subtime=0, walltime=11, res=4, profile=Profiles.Delay(10))
w.new_job(walltime=60, res=4, profile=Profiles.Sequence([
Profiles.Delay(15),
Profiles.Delay(5),
Profiles.Delay(10),
Profiles.Delay(4),
Profiles.Delay(11),
Profiles.Delay(20)]))
w.new_job(walltime=60, res=4, profile=Profiles.Sequence([
Profiles.Delay(5),
Profiles.Sequence([
Profiles.Delay(15),
Profiles.Delay(5),
])]))
Profiles.Delay(3),
Profiles.Delay(14),
Profiles.Delay(7),
]))
w.submit(self)
self.notify_registration_finished()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment