Skip to content

Commit 6f48882

Browse files
authored
Investigate Skipped Tests [HZ-5288] (#1029)
Investigated skipped tests, and enabled useful ones. There are still some tests other than kerberos and cloud which are fine. These are not related with product directly but some internal framework specific thing to verify and the understanding. The tests are investigated; ``` Skipped net8.0.Hazelcast.Tests.Cloud.CloudTests.SampleClient [< 1 ms] Skipped net8.0.Hazelcast.Tests.Cloud.ServerlessCloudTests.RcPathTest [< 1 ms] Skipped net8.0.Hazelcast.Tests.Cloud.ServerlessCloudTests.TestCloud(True,True) [< 1 ms] Skipped net8.0.Hazelcast.Tests.Cloud.ServerlessCloudTests.TestCloud(True,False) [< 1 ms] Skipped net8.0.Hazelcast.Tests.Cloud.ServerlessCloudTests.TestCloud(False,True) [< 1 ms] Skipped net8.0.Hazelcast.Tests.Cloud.ServerlessCloudTests.TestCloud(False,False) [< 1 ms] Skipped net8.0.Hazelcast.Tests.Cloud.ServerlessCloudTests.TestCloudWithResume(True,True) [< 1 ms] Skipped net8.0.Hazelcast.Tests.Cloud.ServerlessCloudTests.TestCloudWithResume(True,False) [< 1 ms] Skipped net8.0.Hazelcast.Tests.Cloud.ServerlessCloudTests.TestCloudWithResume(False,True) [< 1 ms] Skipped net8.0.Hazelcast.Tests.Cloud.ServerlessCloudTests.TestCloudWithResume(False,False) [< 1 ms] Skipped net8.0.Hazelcast.Tests.Clustering.MembersLifecycleTests.Test [< 1 ms] Skipped net8.0.Hazelcast.Tests.Configuration.ConfigurationCollectionBinding.GetListInvalidValues [< 1 ms] Skipped net8.0.Hazelcast.Tests.Configuration.Dynamic.DynamicConfigureMapTests.DefaultOptionsEncodeToSameMessageAsJava [< 1 ms] Skipped net8.0.Hazelcast.Tests.Configuration.Dynamic.DynamicConfigureRingBufferTests.DefaultOptionsEncodeToSameMessageAsJava [< 1 ms] Skipped net8.0.Hazelcast.Tests.DotNet.AsyncTests.Throwing1 [< 1 ms] Skipped net8.0.Hazelcast.Tests.DotNet.AsyncTests.Throwing2 [< 1 ms] Skipped net8.0.Hazelcast.Tests.DotNet.AsyncTests.Throwing3 [< 1 ms] Skipped net8.0.Hazelcast.Tests.DotNet.AsyncTests.Throwing4 [< 1 ms] Skipped net8.0.Hazelcast.Tests.NearCache.NearCacheRecoversFromDistortionsTest.CanConnectToCluster [< 1 ms] Skipped net8.0.Hazelcast.Tests.NearCache.NearCacheRecoversFromDistortionsTest.NearCacheRecoversFromDistortions [< 1 ms] Skipped net8.0.Hazelcast.Tests.Networking.NetworkingTests.CanRetryAndTimeout [< 1 ms] Skipped net8.0.Hazelcast.Tests.Networking.NetworkingTests.Cluster [< 1 ms] Skipped net8.0.Hazelcast.Tests.Networking.SocketConnectionTests.ReadPipeLoop_3 [< 1 ms] Skipped net8.0.Hazelcast.Tests.Remote.ClientCollectionTestBase.TestCollectionUnsubscribeWitDispose [< 1 ms] Skipped net8.0.Hazelcast.Tests.Remote.ClientMapTest.TestAddInterceptor [< 1 ms] Skipped net8.0.Hazelcast.Tests.Remote.ClientCollectionTestBase.TestCollectionUnsubscribeWitDispose [< 1 ms] Skipped net8.0.Hazelcast.Tests.Remote.ClientCollectionTestBase.TestCollectionUnsubscribeWitDispose [< 1 ms] Skipped net8.0.Hazelcast.Tests.Remote.HeartbeatTests.DemoTest [< 1 ms] Skipped net8.0.Hazelcast.Tests.Remote.HeartbeatTests.Heartbeat [< 1 ms] Skipped net8.0.Hazelcast.Tests.Serialization.Compact.CompactQaTests.ExceptionPreventsClientFromReconnecting(True) [< 1 ms] Skipped net8.0.Hazelcast.Tests.Serialization.Compact.CompactQaTests.ExceptionPreventsClientFromReconnecting(False) [< 1 ms] Skipped net8.0.Hazelcast.Tests.Serialization.Compact.CompactQaTests.MemberAddressMatch [< 1 ms] Skipped net8.0.Hazelcast.Tests.Support.Issue501.Reproduce(True) [< 1 ms] Skipped net8.0.Hazelcast.Tests.Support.Issue501.Reproduce(False) [< 1 ms] Skipped net8.0.Hazelcast.Tests.Testing.FeatureConditionIgnoresTest.WouldFail [< 1 ms] Skipped net8.0.Hazelcast.Tests.Testing.NUnitTests.Timeout [< 1 ms] Skipped net8.0.Hazelcast.Tests.Testing.TestConditionIgnoresTest.WouldFail [< 1 ms] Skipped net8.0.Hazelcast.Tests.Testing.TestConditionsTestsBase.CanDoSomethingOn2 [< 1 ms] Skipped net8.0.Hazelcast.Tests.Testing.TestConditionsTestsBase.CannotDoSomethingOn1 [< 1 ms] ```
1 parent a3bac4d commit 6f48882

File tree

11 files changed

+72
-66
lines changed

11 files changed

+72
-66
lines changed

src/Hazelcast.Net.Tests/Clustering/MembersLifecycleTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
namespace Hazelcast.Tests.Clustering
2828
{
2929
[TestFixture]
30-
[Explicit("Stress tests, take time.")]
3130
public class MembersLifecycleTests : MultiMembersRemoteTestBase
3231
{
3332
private const int RunCount = 16;

src/Hazelcast.Net.Tests/Configuration/ConfigurationCollectionBindingTests.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ public void GetListNullValues()
7171
}
7272

7373
[Test]
74-
[Ignore("Our binder throws on purpose.")]
7574
public void GetListInvalidValues()
7675
{
7776
var input = new Dictionary<string, string>
@@ -84,11 +83,8 @@ public void GetListInvalidValues()
8483
configurationBuilder.AddInMemoryCollection(input);
8584
var config = configurationBuilder.Build();
8685
var list = new List<bool>();
87-
config.GetSection("InvalidList").HzBind(list);
8886

89-
//Assert.Single(list);
90-
Assert.AreEqual(list.Count, 1);
91-
Assert.True(list[0]);
87+
Assert.Throws<InvalidOperationException>(()=>config.GetSection("InvalidList").HzBind(list));
9288
}
9389

9490
[Test]

src/Hazelcast.Net.Tests/Configuration/Dynamic/DynamicConfigureMapTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ await client.DynamicOptions.ConfigureMapAsync("map-name", options =>
217217
}
218218

219219
[Test]
220-
[ServerCondition("[5.4]")]
220+
[ServerCondition("5.4")]
221221
public async Task DefaultOptionsEncodeToSameMessageAsJava()
222222
{
223223
const string script = @"

src/Hazelcast.Net.Tests/Configuration/Dynamic/DynamicConfigureRingBufferTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ await client.DynamicOptions.ConfigureRingbufferAsync("buffer-name", options =>
4949
}
5050

5151
[Test]
52-
[ServerCondition("[5.4]")]
52+
[ServerCondition("5.4")]
5353
public async Task DefaultOptionsEncodeToSameMessageAsJava()
5454
{
5555
// CI error: trying to invoke this:

src/Hazelcast.Net.Tests/NearCache/NearCacheRecoversFromDistortionsTest.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
namespace Hazelcast.Tests.NearCache
2222
{
2323
[TestFixture]
24-
[KnownIssue(305, "fails on Linux")]
2524
public class NearCacheRecoversFromDistortionsTest : NearCacheTestBase
2625
{
2726
private IHazelcastClient _client;

src/Hazelcast.Net.Tests/Networking/NetworkingTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ await AssertEx.ThrowsAsync<OperationCanceledException>(async ()
239239

240240
[Test]
241241
[Timeout(10_000)]
242-
[KnownIssue(0, "Breaks on GitHub Actions")] // TODO we should deal with this
243242
public async Task CanRetryAndTimeout()
244243
{
245244
var address = NetworkAddress.Parse("127.0.0.1:" + TestEndPointPort.GetNext());

src/Hazelcast.Net.Tests/Networking/SocketConnectionTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,6 @@ public async Task ReadPipeLoop_2()
346346
}
347347

348348
[Test]
349-
[KnownIssue(0, "Breaks on GitHub Actions")]
350349
public async Task ReadPipeLoop_3()
351350
{
352351
//using var _ = EnableHConsoleForTest();

src/Hazelcast.Net.Tests/Remote/ClientCollectionTestBase.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,8 @@ public async Task TestCollectionUnsubscribeWitDispose()
265265
await Task.Delay(4_000);
266266
Assert.That(eventsCount, Is.Zero);
267267
}
268+
269+
268270

269271
[Test]
270272
public async Task TestCollectionGetAsyncEnumerator()

src/Hazelcast.Net.Tests/Remote/ClientTests.cs

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414
using System;
15+
using System.Text;
16+
using System.Threading;
1517
using System.Threading.Tasks;
1618
using Hazelcast.Configuration;
1719
using Hazelcast.Testing;
20+
using Hazelcast.Testing.Remote;
1821
using Microsoft.Extensions.Configuration;
1922
using NUnit.Framework;
2023

@@ -40,16 +43,16 @@ public async Task ClientCanConnect()
4043
[Test]
4144
public async Task ClientStartingClientWithConfig()
4245
{
43-
var clientStarting = HazelcastClientFactory.GetNewStartingClient(CreateHazelcastOptions());
46+
var clientStarting = HazelcastClientFactory.GetNewStartingClient(CreateHazelcastOptions());
4447
await clientStarting.Task;
4548
await clientStarting.Client.DisposeAsync();
4649
}
47-
50+
4851
[Test]
4952
public async Task ClientStatringClientWithConfig2()
5053
{
5154
var o = CreateHazelcastOptions();
52-
var clientStarting = HazelcastClientFactory.GetNewStartingClient(options=>
55+
var clientStarting = HazelcastClientFactory.GetNewStartingClient(options =>
5356
{
5457
options.Networking.Addresses.Clear();
5558
options.Networking.Addresses.Add("127.0.0.1:5701");
@@ -66,8 +69,8 @@ public async Task ClientCanConnectAsync()
6669

6770
//using var _ = HConsole.Capture(options => options
6871
// .Set(x => x.SetLevel(1)));
69-
70-
Assert.Throws<ArgumentNullException>(() => HazelcastClientFactory.GetNewStartingClient((HazelcastOptions)null));
72+
73+
Assert.Throws<ArgumentNullException>(() => HazelcastClientFactory.GetNewStartingClient((HazelcastOptions) null));
7174

7275
var clientStart = HazelcastClientFactory.GetNewStartingClient(CreateHazelcastOptions());
7376
var client = clientStart.Client;
@@ -99,7 +102,7 @@ public async Task StartingFailoverClientCanConnect()
99102
await startingClient.Task;
100103
await startingClient.Client.DisposeAsync();
101104
}
102-
105+
103106
[Test]
104107
[Category("enterprise")] // Failover is an Enterprise feature
105108
public async Task StartingFailoverClientCanConnect2()
@@ -113,7 +116,7 @@ public async Task StartingFailoverClientCanConnect2()
113116
await startingClient.Task;
114117
await startingClient.Client.DisposeAsync();
115118
}
116-
119+
117120
[Test]
118121
[Category("enterprise")] // Failover is an Enterprise feature
119122
public async Task FailoverClientCanConnect2()
@@ -126,7 +129,7 @@ public async Task FailoverClientCanConnect2()
126129
var client = await HazelcastClientFactory.StartNewFailoverClientAsync(opt =>
127130
{
128131
opt.Clients.Add(CreateHazelcastOptions());
129-
opt.TryCount=1;
132+
opt.TryCount = 1;
130133
});
131134

132135
await client.DisposeAsync();
@@ -141,7 +144,7 @@ public async Task FailoverClientCanConnectAsync()
141144
//using var _ = HConsole.Capture(options => options
142145
// .Set(x => x.SetLevel(1)));
143146

144-
Assert.Throws<ArgumentNullException>(() => HazelcastClientFactory.GetNewStartingFailoverClient((HazelcastFailoverOptions)null));
147+
Assert.Throws<ArgumentNullException>(() => HazelcastClientFactory.GetNewStartingFailoverClient((HazelcastFailoverOptions) null));
145148

146149
var clientStart = HazelcastClientFactory.GetNewStartingFailoverClient(CreateHazelcastFailoverOptions());
147150
var client = clientStart.Client;
@@ -164,5 +167,36 @@ private HazelcastFailoverOptions CreateHazelcastFailoverOptions()
164167

165168
return failoverOptions;
166169
}
170+
171+
[Test]
172+
[Ignore("DisposeAsync should unsubscribe events")]
173+
public async Task TestSubscriptionsRemovedDuringDispose()
174+
{
175+
var client = await HazelcastClientFactory.StartNewClientAsync(CreateHazelcastOptions());
176+
177+
var mapName = "map-test-subscriptions-removed-during-dispose";
178+
var map = await client.GetMapAsync<int, int>(mapName);
179+
var eventsCount = 0;
180+
var sid = await map.SubscribeAsync(events => events
181+
.EntryAdded((sender, args) => { Interlocked.Increment(ref eventsCount); }));
182+
183+
Assert.AreEqual(0, await map.GetSizeAsync());
184+
await map.PutAsync(1, 1);
185+
await AssertEx.SucceedsEventually(() => Assert.NotZero(eventsCount), 5000, 200);
186+
187+
await map.DisposeAsync();
188+
189+
var script = @"
190+
191+
var nodeEngineImpl = com.hazelcast.instance.impl.TestUtil.getNode(instance_0).nodeEngine;
192+
var es = nodeEngineImpl.getEventService();
193+
var hasIt = es.hasEventRegistration(""hz:impl:mapService"",""" + mapName + "\");" +
194+
@" result = hasIt ? ""True"":""False""; ";
195+
196+
197+
var response = await RcClient.ExecuteOnControllerAsync(RcCluster.Id, script, Lang.JAVASCRIPT, CancellationToken.None);
198+
199+
Assert.False(Convert.ToBoolean(Encoding.UTF8.GetString(response.Result)));
200+
}
167201
}
168202
}

src/Hazelcast.Net.Tests/Remote/HeartbeatTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
namespace Hazelcast.Tests.Remote
2727
{
2828
[TestFixture]
29-
[Explicit("Takes time")]
3029
public class HeartbeatTests : SingleMemberRemoteTestBase
3130
{
3231
protected override HazelcastOptions CreateHazelcastOptions()

0 commit comments

Comments
 (0)