aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-12-31 15:48:52 -0600
committerluigi1111 <luigi1111w@gmail.com>2018-12-31 15:48:52 -0600
commit4a78bcd275209f98f2f6aaf37729dff825e32517 (patch)
treeda6500f8f26eaa556a757c321a98a9199e13a7e2 /tests/unit_tests
parentMerge pull request #4940 (diff)
parentunit_tests: strengthen notify test against OS scheduling (diff)
downloadmonero-4a78bcd275209f98f2f6aaf37729dff825e32517.tar.xz
Merge pull request #4941
1cfd6f1 unit_tests: strengthen notify test against OS scheduling (moneromooo-monero)
Diffstat (limited to 'tests/unit_tests')
-rw-r--r--tests/unit_tests/notify.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/tests/unit_tests/notify.cpp b/tests/unit_tests/notify.cpp
index 105d21ca8..cd70b7739 100644
--- a/tests/unit_tests/notify.cpp
+++ b/tests/unit_tests/notify.cpp
@@ -69,11 +69,22 @@ TEST(notify, works)
tools::Notify notify(spec.c_str());
notify.notify("1111111111111111111111111111111111111111111111111111111111111111");
- epee::misc_utils::sleep_no_w(100);
-
- std::string s;
- ASSERT_TRUE(epee::file_io_utils::load_file_to_string(name_template, s));
- ASSERT_TRUE(s == "1111111111111111111111111111111111111111111111111111111111111111");
+ bool ok = false;
+ for (int i = 0; i < 10; ++i)
+ {
+ epee::misc_utils::sleep_no_w(100);
+ std::string s;
+ if (epee::file_io_utils::load_file_to_string(name_template, s))
+ {
+ if (s == "1111111111111111111111111111111111111111111111111111111111111111")
+ {
+ ok = true;
+ break;
+ }
+ std::cout << "got: [" << s << "]" << std::endl;
+ }
+ }
boost::filesystem::remove(name_template);
+ ASSERT_TRUE(ok);
}