Skip to content

Commit 3301fa3

Browse files
authored
Make keys unique in ClientTxnMultiMapTest.testPutGetRemove (#924)
1 parent 7b9f022 commit 3301fa3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

hazelcast/test/src/HazelcastTests1.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2747,9 +2747,9 @@ namespace hazelcast {
27472747

27482748
std::array<boost::future<void>, n> futures;
27492749
for (int i = 0; i < n; i++) {
2750-
futures[i] = boost::async(std::packaged_task<void()>([&]() {
2751-
std::string key = std::to_string(hazelcast::util::get_current_thread_id());
2752-
std::string key2 = key + "2";
2750+
futures[i] = boost::async([&mm, this, i]() {
2751+
std::string key = std::to_string(i);
2752+
std::string key2 = key + "-2";
27532753
client_.get_multi_map("testPutGetRemove").get()->put(key, "value").get();
27542754
transaction_context context = client_.new_transaction_context();
27552755
context.begin_transaction().get();
@@ -2768,7 +2768,7 @@ namespace hazelcast {
27682768
context.commit_transaction().get();
27692769

27702770
ASSERT_EQ(3, (int) (mm->get<std::string, std::string>(key).get().size()));
2771-
}));
2771+
});
27722772
}
27732773

27742774
boost::wait_for_all(futures.begin(), futures.end());

0 commit comments

Comments
 (0)