-
Notifications
You must be signed in to change notification settings - Fork 50
Disable ttl based tests in ClientMapTest suite for near cache client [HZ-5308] [HZ-5310] #1388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1172,6 +1172,13 @@ TEST_P(ClientMapTest, testTryPutRemove) | |
|
|
||
| TEST_P(ClientMapTest, testPutTtl) | ||
| { | ||
| if (client_.get_client_config().get_near_cache_config(imap_->get_name()) != | ||
| nullptr) { | ||
| GTEST_SKIP_( | ||
| "Server side expiry does not send near cache invalidations. " | ||
| "See https://github.com/hazelcast/hazelcast/issues/10975"); | ||
| } | ||
|
|
||
| validate_expiry_invalidations(imap_, [=]() { | ||
| imap_ | ||
| ->put<std::string, std::string>( | ||
|
|
@@ -1182,6 +1189,13 @@ TEST_P(ClientMapTest, testPutTtl) | |
|
|
||
| TEST_P(ClientMapTest, testPutConfigTtl) | ||
| { | ||
| if (client_.get_client_config().get_near_cache_config( | ||
| ONE_SECOND_MAP_NAME) != nullptr) { | ||
| GTEST_SKIP_( | ||
| "Server side expiry does not send near cache invalidations. " | ||
| "See https://github.com/hazelcast/hazelcast/issues/10975"); | ||
| } | ||
|
|
||
| std::shared_ptr<imap> map = client_.get_map(ONE_SECOND_MAP_NAME).get(); | ||
| validate_expiry_invalidations(map, [=]() { | ||
| map->put<std::string, std::string>("key1", "value1").get(); | ||
|
|
@@ -1201,9 +1215,16 @@ TEST_P(ClientMapTest, testPutIfAbsent) | |
|
|
||
| TEST_P(ClientMapTest, testPutIfAbsentTtl) | ||
| { | ||
| if (client_.get_client_config().get_near_cache_config(imap_->get_name()) != | ||
| nullptr) { | ||
| GTEST_SKIP_( | ||
| "Server side expiry does not send near cache invalidations. " | ||
| "See https://github.com/hazelcast/hazelcast/issues/10975"); | ||
| } | ||
|
|
||
| ASSERT_FALSE((imap_ | ||
| ->put_if_absent<std::string, std::string>( | ||
| "key1", "value1", std::chrono::seconds(1)) | ||
| "key1", "value1", std::chrono::seconds(10)) | ||
| .get() | ||
| .has_value())); | ||
| ASSERT_EQ("value1", | ||
|
|
@@ -1213,11 +1234,15 @@ TEST_P(ClientMapTest, testPutIfAbsentTtl) | |
| .get() | ||
| .value())); | ||
|
|
||
| ASSERT_FALSE_EVENTUALLY((imap_ | ||
| ->put_if_absent<std::string, std::string>( | ||
| "key1", "value3", std::chrono::seconds(1)) | ||
| .get() | ||
| .has_value())); | ||
| ASSERT_FALSE_EVENTUALLY( | ||
| (imap_->get<std::string, std::string>("key1").get().has_value())); | ||
|
|
||
| ASSERT_FALSE((imap_ | ||
| ->put_if_absent<std::string, std::string>( | ||
| "key1", "value3", std::chrono::seconds(10)) | ||
| .get() | ||
| .has_value())); | ||
|
Comment on lines
+1240
to
+1244
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did this get reformatted?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. line changed and used clang-format to format. do you mean the indentation of the lines?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes. The codebase should have a consistent format now so this shouldn't have needed to change. If it did, then there must be a tooling difference between our respective
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh it changed. From
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, the build Build&Test PR / enforce-code-formatting (pull_request_target) is green :) |
||
|
|
||
| ASSERT_EQ("value3", | ||
| (imap_ | ||
| ->put_if_absent<std::string, std::string>( | ||
|
|
@@ -1239,13 +1264,27 @@ TEST_P(ClientMapTest, testSet) | |
|
|
||
| TEST_P(ClientMapTest, testSetTtl) | ||
| { | ||
| if (client_.get_client_config().get_near_cache_config(imap_->get_name()) != | ||
| nullptr) { | ||
| GTEST_SKIP_( | ||
| "Server side expiry does not send near cache invalidations. " | ||
| "See https://github.com/hazelcast/hazelcast/issues/10975"); | ||
| } | ||
|
|
||
| validate_expiry_invalidations(imap_, [=]() { | ||
| imap_->set("key1", "value1", std::chrono::seconds(1)).get(); | ||
| }); | ||
| } | ||
|
|
||
| TEST_P(ClientMapTest, testSetConfigTtl) | ||
| { | ||
| if (client_.get_client_config().get_near_cache_config( | ||
| ONE_SECOND_MAP_NAME) != nullptr) { | ||
| GTEST_SKIP_( | ||
| "Server side expiry does not send near cache invalidations. " | ||
| "See https://github.com/hazelcast/hazelcast/issues/10975"); | ||
| } | ||
|
|
||
| std::shared_ptr<imap> map = client_.get_map(ONE_SECOND_MAP_NAME).get(); | ||
| validate_expiry_invalidations(map, | ||
| [=]() { map->set("key1", "value1").get(); }); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dislike the magic
10but as you've highlighted, it already exists inhazelcast.