Skip to content

Commit

Permalink
Test Memory bug--
Browse files Browse the repository at this point in the history
  • Loading branch information
henricasanova committed Aug 4, 2019
1 parent f53e346 commit dfc2113
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/wrench/managers/JobManager.cpp
Expand Up @@ -431,6 +431,11 @@ namespace wrench {
throw std::invalid_argument("JobManager::forgetJob(): invalid argument");
}

// Check the job is somewhere
if (this->jobs.find(job) == this->jobs.end()) {
throw std::invalid_argument("JobManager::forgetJob(): unknown job");
}

if (job->getType() == WorkflowJob::STANDARD) {

if ((this->pending_standard_jobs.find((StandardJob *) job) != this->pending_standard_jobs.end()) ||
Expand Down
2 changes: 2 additions & 0 deletions test/compute_services/BatchService/BatchServiceTest.cpp
Expand Up @@ -728,9 +728,11 @@ class OnePilotJobSubmissionTestWMS : public wrench::WMS {
// Create a pilot job that needs 1 host, 1 code, 0 bytes of RAM and 30 seconds
wrench::PilotJob *pilot_job = job_manager->createPilotJob();
// Forgetting the job right-away for coverage
WRENCH_INFO("FORGETTINGJOB");
job_manager->forgetJob(pilot_job);
// Forgetting the job again, which is wrong,for coverage
try {
WRENCH_INFO("FORGETTINGJOB AGAIN");
job_manager->forgetJob(pilot_job);
throw std::runtime_error("Should not be able to forget already forgotten pilot job");
} catch (std::invalid_argument &e) {
Expand Down

0 comments on commit dfc2113

Please sign in to comment.