From 3467567c13628f47011a2c5d58a587f5efd94169 Mon Sep 17 00:00:00 2001 From: henricasanova Date: Thu, 10 Oct 2019 09:22:06 -1000 Subject: [PATCH] (#2) test passing++ --- .../work_unit_executor/WorkunitExecutor.cpp | 2 -- src/wrench/services/storage/StorageService.cpp | 2 ++ .../storage/simple/SimpleStorageService.cpp | 2 +- .../SimulationTimestampFileCopyTest.cpp | 17 ++++++++++------- .../SimulationTimestampTaskTest.cpp | 10 +++++++++- .../DataMovementManagerCopyRegisterTest.cpp | 2 -- test/workflow/WorkflowTaskTest.cpp | 3 +-- 7 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/wrench/services/compute/work_unit_executor/WorkunitExecutor.cpp b/src/wrench/services/compute/work_unit_executor/WorkunitExecutor.cpp index 9976745067..013feb38cc 100644 --- a/src/wrench/services/compute/work_unit_executor/WorkunitExecutor.cpp +++ b/src/wrench/services/compute/work_unit_executor/WorkunitExecutor.cpp @@ -335,8 +335,6 @@ namespace wrench { } } StorageService::readFiles(files_to_read); - WRENCH_INFO("SETTING TASK %s's READ INPUT END DATE TO %lf", - task->getID().c_str(), S4U_Simulation::getClock()); task->setReadInputEndDate(S4U_Simulation::getClock()); } catch (WorkflowExecutionException &e) { this->failure_timestamp_should_be_generated = true; diff --git a/src/wrench/services/storage/StorageService.cpp b/src/wrench/services/storage/StorageService.cpp index 1f9bf19742..e5dc3233c7 100644 --- a/src/wrench/services/storage/StorageService.cpp +++ b/src/wrench/services/storage/StorageService.cpp @@ -554,6 +554,7 @@ namespace wrench { // Send a message to the daemon of the dst service std::string answer_mailbox = S4U_Mailbox::generateUniqueMailboxName("copy_file"); + WRENCH_INFO("GENERATING FILE COPY START TIMESTAMP (SYNC)"); auto start_timestamp = new SimulationTimestampFileCopyStart(file, src_location, dst_location); src_location->getStorageService()->simulation->getOutput().addTimestamp(start_timestamp); @@ -619,6 +620,7 @@ namespace wrench { assertServiceIsUp(src_location->getStorageService()); assertServiceIsUp(dst_location->getStorageService()); + WRENCH_INFO("GENERATING FILE COPY START (FOR ASYNC)"); auto start_timestamp = new SimulationTimestampFileCopyStart(file, src_location, dst_location); src_location->getStorageService()->simulation->getOutput().addTimestamp(start_timestamp); diff --git a/src/wrench/services/storage/simple/SimpleStorageService.cpp b/src/wrench/services/storage/simple/SimpleStorageService.cpp index 4ea90d3d89..63e3d46dd7 100644 --- a/src/wrench/services/storage/simple/SimpleStorageService.cpp +++ b/src/wrench/services/storage/simple/SimpleStorageService.cpp @@ -118,7 +118,7 @@ namespace wrench { std::string message = "Simple Storage service " + this->getName() + " starting on host " + this->getHostname(); for (auto const &fs : this->file_systems) { - message += "\n\t- " + fs.first + ": " + + message += "\n\t- mount point " + fs.first + ": " + std::to_string(fs.second->getFreeSpace()) + "/" + std::to_string(fs.second->getTotalCapacity()) + " Bytes"; } diff --git a/test/simulation/simulation_output/SimulationTimestampFileCopyTest.cpp b/test/simulation/simulation_output/SimulationTimestampFileCopyTest.cpp index 9bf286e940..8d894d5247 100644 --- a/test/simulation/simulation_output/SimulationTimestampFileCopyTest.cpp +++ b/test/simulation/simulation_output/SimulationTimestampFileCopyTest.cpp @@ -8,6 +8,9 @@ #include "../../include/TestWithFork.h" #include "../../include/UniqueTmpPathPrefix.h" +WRENCH_LOG_NEW_DEFAULT_CATEGORY(simulation_timestamp_file_copy_test, "Log category for SimulationTimestampFileCopyTest"); + + class SimulationTimestampFileCopyTest : public ::testing::Test { public: @@ -93,39 +96,39 @@ class SimulationTimestampFileCopyBasicTestWMS : public wrench::WMS { auto dmm = this->createDataMovementManager(); // regular copy with successful completion + WRENCH_INFO("DOING SYNCHRONOUS COPY"); dmm->doSynchronousFileCopy(this->test->file_1, wrench::FileLocation::LOCATION(this->test->source_storage_service), wrench::FileLocation::LOCATION(this->test->destination_storage_service)); + WRENCH_INFO("DOING ASYNCHRONOUS COPY"); dmm->initiateAsynchronousFileCopy(this->test->xl_file, wrench::FileLocation::LOCATION(this->test->source_storage_service), wrench::FileLocation::LOCATION(this->test->destination_storage_service)); + WRENCH_INFO("DOING SYNCHRONOUS COPY"); dmm->doSynchronousFileCopy(this->test->file_2, wrench::FileLocation::LOCATION(this->test->source_storage_service), wrench::FileLocation::LOCATION(this->test->destination_storage_service)); + WRENCH_INFO("DOING SYNCHRONOUS COPY"); dmm->doSynchronousFileCopy(this->test->file_3, wrench::FileLocation::LOCATION(this->test->source_storage_service), wrench::FileLocation::LOCATION(this->test->destination_storage_service)); - bool failed = false; - // this should fail and a SimulationTimestampFileCopyFailure should be created try { + WRENCH_INFO("DOING SYNCHRONOUS COPY THAT WILL FAIL"); dmm->doSynchronousFileCopy(this->test->too_large_file, wrench::FileLocation::LOCATION(this->test->source_storage_service), wrench::FileLocation::LOCATION(this->test->destination_storage_service)); - } catch(wrench::WorkflowExecutionException &e) { - failed = true; - } - if (not failed) { throw std::runtime_error("file copy should have failed"); + } catch(wrench::WorkflowExecutionException &e) { } // wait for xl_file file copy to complete - simulation->sleep(100); + wrench::Simulation::sleep(100); /* * expected outcome: diff --git a/test/simulation/simulation_output/SimulationTimestampTaskTest.cpp b/test/simulation/simulation_output/SimulationTimestampTaskTest.cpp index fac4ccca85..6cefd4cd87 100644 --- a/test/simulation/simulation_output/SimulationTimestampTaskTest.cpp +++ b/test/simulation/simulation_output/SimulationTimestampTaskTest.cpp @@ -41,6 +41,10 @@ class SimulationTimestampTaskTest : public ::testing::Test { " " " " " " + " " + " " + " " + " " " " " " " " @@ -51,6 +55,10 @@ class SimulationTimestampTaskTest : public ::testing::Test { " " " " " " + " " + " " + " " + " " " " " " " " @@ -346,7 +354,7 @@ void SimulationTimestampTaskTest::do_SimulationTimestampTaskMultiple_test() { {}))); ASSERT_NO_THROW(storage_service = simulation->add(new wrench::SimpleStorageService(wms_host, {"/"}))); - ASSERT_NO_THROW(backup_storage_service = simulation->add(new wrench::SimpleStorageService(wms_host, {"/"}))); + ASSERT_NO_THROW(backup_storage_service = simulation->add(new wrench::SimpleStorageService(wms_host, {"/backup"}))); std::shared_ptr wms = nullptr;; diff --git a/test/storage_services/SimpleStorageService/DataMovementManagerCopyRegisterTest.cpp b/test/storage_services/SimpleStorageService/DataMovementManagerCopyRegisterTest.cpp index 695e0aa1e9..1b3c2a37a1 100644 --- a/test/storage_services/SimpleStorageService/DataMovementManagerCopyRegisterTest.cpp +++ b/test/storage_services/SimpleStorageService/DataMovementManagerCopyRegisterTest.cpp @@ -140,7 +140,6 @@ class DataMovementManagerCopyRegisterTestWMS : public wrench::WMS { throw std::runtime_error("Synchronous file copy succeeded but file was not registered at DstHost"); } - WRENCH_INFO("==========================================="); // Do the same thing but kill the FileRegistryService first wrench::StorageService::deleteFile(this->test->src_file_1, @@ -176,7 +175,6 @@ class DataMovementManagerCopyRegisterTestWMS : public wrench::WMS { throw std::runtime_error("Got an exception while trying to instantiate a file copy: " + std::string(e.what())); } - WRENCH_INFO("==========================================="); try { async_copy_event = this->getWorkflow()->waitForNextExecutionEvent(); } catch (wrench::WorkflowExecutionException &e) { diff --git a/test/workflow/WorkflowTaskTest.cpp b/test/workflow/WorkflowTaskTest.cpp index 97707f09b4..bc1c658b0d 100644 --- a/test/workflow/WorkflowTaskTest.cpp +++ b/test/workflow/WorkflowTaskTest.cpp @@ -293,7 +293,7 @@ class WorkflowTaskExecutionHistoryTestWMS : public wrench::WMS { wrench::StandardJob *job_that_will_complete = job_manager->createStandardJob(this->test->t4, {{this->test->small_input_file, - wrench::FileLocation::LOCATION(this->test->storage_service)}, + wrench::FileLocation::LOCATION(this->test->backup_storage_service)}, {this->test->large_input_file, wrench::FileLocation::LOCATION(this->test->storage_service)}, {this->test->t4_output_file, @@ -383,7 +383,6 @@ void WorkflowTaskTest::do_WorkflowTaskExecutionHistory_test() { // none of the values should be -1 except task_failure for (auto &value : t4_successful_execution_history_values) { - WRENCH_INFO("VALUE=%lf", value); ASSERT_NE(value, -1.0); }