Skip to content

Commit

Permalink
Merge pull request #2283 from pnorbert/test-add-delay
Browse files Browse the repository at this point in the history
Use DelayMS in TestCommonWriteLocal like as in TestCommonWrite.
  • Loading branch information
pnorbert authored and Chuck Atkins committed May 22, 2020
2 parents ae2cb9e + 8d7a95a commit f744a13
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions testing/adios2/engine/staging-common/TestCommonWriteLocal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
#include <cstring>
#include <ctime>

#include <chrono>
#include <iostream>
#include <stdexcept>
#include <thread>

#include <adios2.h>

Expand Down Expand Up @@ -167,6 +169,8 @@ TEST_F(CommonWriteTest, ADIOS2CommonWrite)
std::time_t localtime = std::time(NULL);
engine.Put(var_time, (int64_t *)&localtime);
engine.EndStep();
std::this_thread::sleep_for(std::chrono::milliseconds(
DelayMS)); /* sleep for DelayMS milliseconds */
}

// Close the file
Expand All @@ -188,6 +192,8 @@ int main(int argc, char **argv)
int result;
::testing::InitGoogleTest(&argc, argv);

DelayMS = 0; // zero for common writer

ParseArgs(argc, argv);

result = RUN_ALL_TESTS();
Expand Down

0 comments on commit f744a13

Please sign in to comment.