Skip to content

Commit

Permalink
debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
henricasanova committed Dec 15, 2023
1 parent a17cac6 commit 07c59bc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,8 @@ namespace wrench {
return;
}

std::cerr << "action->NAME: " << action->getName() << "\n";

this->dispatched_actions.erase(action);
this->num_dispatched_actions_for_cjob[action->getJob()]--;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,31 +49,31 @@ int wrench::ResourceRandomRepeatSwitcher::main() {

while (true) {
double sleep_before_off_time = dist_off(rng);
WRENCH_INFO("Sleeping for %.3lf seconds...", sleep_before_off_time);
WRENCH_INFO("CHAOS MONKEY: Sleeping for %.3lf seconds...", sleep_before_off_time);
wrench::Simulation::sleep(sleep_before_off_time);
switch (this->resource_type) {
case ResourceType::HOST: {
WRENCH_INFO("Turning OFF host %s", this->resource_to_switch.c_str());
WRENCH_INFO("CHAOS MONKEY: Turning OFF host %s", this->resource_to_switch.c_str());
wrench::Simulation::turnOffHost(this->resource_to_switch);
break;
}
case ResourceType::LINK: {
WRENCH_INFO("Turning OFF link %s", this->resource_to_switch.c_str());
WRENCH_INFO("CHAOS MONKEY: Turning OFF link %s", this->resource_to_switch.c_str());
wrench::Simulation::turnOffLink(this->resource_to_switch);
break;
}
}
double sleep_before_on_time = dist_on(rng);
WRENCH_INFO("Sleeping for %.3lf seconds...", sleep_before_on_time);
WRENCH_INFO("CHAOS MONKEY: Sleeping for %.3lf seconds...", sleep_before_on_time);
wrench::Simulation::sleep(sleep_before_on_time);
switch (this->resource_type) {
case ResourceType::HOST: {
WRENCH_INFO("Turning ON host %s", this->resource_to_switch.c_str());
WRENCH_INFO("CHAOS MONKEY: Turning ON host %s", this->resource_to_switch.c_str());
wrench::Simulation::turnOnHost(this->resource_to_switch);
break;
}
case ResourceType::LINK: {
WRENCH_INFO("Turning ON link %s", this->resource_to_switch.c_str());
WRENCH_INFO("CHAOS MONKEY: Turning ON link %s", this->resource_to_switch.c_str());
wrench::Simulation::turnOnLink(this->resource_to_switch);
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@

WRENCH_LOG_CATEGORY(comprehensive_integration_host_failure_test, "Log category for ComprehensiveIntegrationHostFailuresTest");

#define NUM_TASKS 100
//#define NUM_TASKS 100
#define NUM_TASKS 3
#define MAX_TASK_DURATION_WITH_ON_CORE 3600
#define CHAOS_MONKEY_MIN_SLEEP_BEFORE_OFF 100
//#define CHAOS_MONKEY_MAX_SLEEP_BEFORE_OFF 3000// The bigger this number the less flaky the platform
#define CHAOS_MONKEY_MAX_SLEEP_BEFORE_OFF 3000// The bigger this number the less flaky the platform
#define CHAOS_MONKEY_MIN_SLEEP_BEFORE_ON 100
#define CHAOS_MONKEY_MAX_SLEEP_BEFORE_ON 2000// The bigger this number the more flaky the platform
Expand Down Expand Up @@ -223,6 +225,7 @@ class IntegrationFailureTestTestWMS : public wrench::ExecutionController {


while (not this->test->workflow->isDone()) {
// std::cerr << this->test->workflow->getReadyTasks().size() << "\n";

// Try to restart down VMs
for (auto const &vm: this->vms) {
Expand Down Expand Up @@ -304,6 +307,8 @@ class IntegrationFailureTestTestWMS : public wrench::ExecutionController {
{task->getOutputFiles().at(0), wrench::FileLocation::LOCATION(target_storage_service, task->getOutputFiles().at(0))},
});
this->job_manager->submitJob(job, target_cs);
std::cerr << "############ SUBMITTED TASK " << task->getID() << "\n";


// WRENCH_INFO("Submitted task1 '%s' to '%s' with files to read from '%s",
// task1->getID().c_str(),
Expand All @@ -313,7 +318,10 @@ class IntegrationFailureTestTestWMS : public wrench::ExecutionController {
}

void processEventStandardJobCompletion(std::shared_ptr<wrench::StandardJobCompletedEvent> event) override {
static int count = 0;
auto task = *(event->standard_job->getTasks().begin());
count++;
std::cerr << "############ TASK " << task->getID() << " HAS COMPLETED!\n";
WRENCH_INFO("Task '%s' has completed", task->getID().c_str());
if (event->compute_service == this->test->baremetal_service) {
num_jobs_on_baremetal_cs--;
Expand All @@ -328,6 +336,8 @@ class IntegrationFailureTestTestWMS : public wrench::ExecutionController {

void processEventStandardJobFailure(std::shared_ptr<wrench::StandardJobFailedEvent> event) override {
auto task = *(event->standard_job->getTasks().begin());
std::cerr << "############ TASK " << task->getID() << " HAS FAILED!\n";

WRENCH_INFO("Task '%s' has failed: %s", task->getID().c_str(), event->failure_cause->toString().c_str());
if (event->compute_service == this->test->baremetal_service) {
num_jobs_on_baremetal_cs--;
Expand Down Expand Up @@ -405,12 +415,12 @@ void ComprehensiveIntegrationHostFailuresTest::do_IntegrationFailureTest_test(st

// Create and initialize a simulation
auto simulation = wrench::Simulation::createSimulation();
int argc = 3;
int argc = 4;
auto argv = (char **) calloc(argc, sizeof(char *));
argv[0] = strdup("unit_test");
argv[1] = strdup("--wrench-host-shutdown-simulation");
argv[2] = strdup("--cfg=contexts/stack-size:100");
// argv[3] = strdup("--wrench-full-log");
argv[3] = strdup("--wrench-full-log");

this->faulty_map = args;

Expand Down

0 comments on commit 07c59bc

Please sign in to comment.