Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/config.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
JAVA_VERSION=17
JAVA_DISTRIBUTION=temurin
MAVEN_VERSION=3.9.11
HZ_VERSION=5.6.0
HZ_VERSION=5.7.0-SNAPSHOT
57 changes: 17 additions & 40 deletions hazelcast/test/src/HazelcastTests5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -738,9 +738,15 @@ class PartitionAwareInt : public partition_aware<int>
int actual_key_;
};

struct client_config_param
{
std::string name;
std::function<client_config()> factory;
};

class ClientMapTest
: public ClientTest
, public ::testing::WithParamInterface<std::function<client_config()>>
, public ::testing::WithParamInterface<client_config_param>
{
public:
static constexpr const char* intMapName = "IntMap";
Expand Down Expand Up @@ -787,7 +793,7 @@ class ClientMapTest
}

ClientMapTest()
: client_(new_client(GetParam()()).get())
: client_(new_client(GetParam().factory()).get())
, imap_(client_.get_map(imapName).get())
, int_map_(client_.get_map(intMapName).get())
, employees_(client_.get_map(employeesMapName).get())
Expand Down Expand Up @@ -951,9 +957,15 @@ INSTANTIATE_TEST_SUITE_P(
ClientMapTestWithDifferentConfigs,
ClientMapTest,
::testing::Values(
ClientMapTest::create_map_client_config,
ClientMapTest::create_near_cached_map_client_config,
ClientMapTest::create_near_cached_object_map_client_config));
client_config_param{ "Default", &ClientMapTest::create_map_client_config },
client_config_param{ "NearCachedBinary",
&ClientMapTest::create_near_cached_map_client_config },
client_config_param{
"NearCachedObject",
&ClientMapTest::create_near_cached_object_map_client_config }),
[](const ::testing::TestParamInfo<client_config_param>& info) {
return info.param.name;
});

TEST_P(ClientMapTest, testIssue537)
{
Expand Down Expand Up @@ -1172,13 +1184,6 @@ 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>(
Expand All @@ -1189,13 +1194,6 @@ 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();
Expand All @@ -1215,13 +1213,6 @@ 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(10))
Expand Down Expand Up @@ -1264,27 +1255,13 @@ 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(); });
Expand Down
2 changes: 1 addition & 1 deletion scripts/start-rc.bat
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no publish 5.7.0-SNAPSHOT artifact. Is it a good idea for the client to require this? It might make community contributions more difficult.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can start the rc with environment HZ_VERSION, hence, any community can use any version. This is the only version that can work with the latest PR changes, hence, we need it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we also update (e.g.!)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch. Fixed at fcbe329

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
setlocal EnableDelayedExpansion

if "%HZ_VERSION%"=="" (
set HZ_VERSION=5.6.0
set HZ_VERSION=5.7.0-SNAPSHOT
)
set HAZELCAST_TEST_VERSION=%HZ_VERSION%
set HAZELCAST_ENTERPRISE_VERSION=%HZ_VERSION%
Expand Down
2 changes: 1 addition & 1 deletion scripts/start-rc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ set +x

trap cleanup EXIT

HZ_VERSION=${HZ_VERSION:-5.6.0}
HZ_VERSION=${HZ_VERSION:-5.7.0-SNAPSHOT}
HAZELCAST_TEST_VERSION=${HZ_VERSION}
HAZELCAST_ENTERPRISE_VERSION=${HZ_VERSION}
HAZELCAST_RC_VERSION=0.8-SNAPSHOT
Expand Down
Loading