Skip to content

Commit

Permalink
Fix test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
emreyigit committed May 16, 2024
1 parent bd314c2 commit 9bc197a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
2 changes: 2 additions & 0 deletions src/Hazelcast.Net.Tests/CP/CPMapTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
using Hazelcast.Protocol;
using Hazelcast.Protocol.Models;
using Hazelcast.Testing;
using Hazelcast.Testing.Conditions;
using Hazelcast.Testing.Remote;
using NUnit.Framework;

namespace Hazelcast.Tests.CP;

[Category("enterprise")]
[ServerCondition("[5.4)")]
public class CPMapTests : MultiMembersRemoteTestBase
{
private string _defaultMapName = "myMap";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Hazelcast.Core;
using Hazelcast.Messaging;
using Hazelcast.Messaging.FrameFields;
using Hazelcast.Models;
using Hazelcast.NearCaching;
using Hazelcast.Protocol.Codecs;
using Hazelcast.Protocol.Models;
using Hazelcast.Testing;
using Hazelcast.Testing.Remote;
using Hazelcast.Testing.Conditions;
using NUnit.Framework;

namespace Hazelcast.Tests.Configuration.Dynamic;

[TestFixture]
Expand Down Expand Up @@ -226,6 +218,7 @@ public async Task CanConfigureEverything()
}

[Test]
[ServerCondition("5.4")]
public async Task DefaultOptionsEncodeToSameMessageAsJava()
{
const string script = @"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using Hazelcast.Models;
using Hazelcast.Protocol.Codecs;
using Hazelcast.Protocol.Models;
using Hazelcast.Testing.Conditions;
using NUnit.Framework;

namespace Hazelcast.Tests.Configuration.Dynamic;
Expand Down Expand Up @@ -49,6 +50,7 @@ public async Task CanConfigureEverything()
}

[Test]
[ServerCondition("5.4")]
public async Task DefaultOptionsEncodeToSameMessageAsJava()
{
// CI error: trying to invoke this:
Expand Down
7 changes: 2 additions & 5 deletions src/Hazelcast.Net.Tests/DotNet/AsyncTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,9 @@ public async Task WhenAllCancel()

var task1 = Task.Delay(2_000, cancellation.Token);
var task2 = semaphore.WaitAsync(cancellation.Token);
#if NET8_0_OR_GREATER
// see https://github.com/dotnet/runtime/issues/83382 the exception type changed in .NET 8.0
Assert.ThrowsAsync<OperationCanceledException>(async () => await Task.WhenAll(task1, task2).CfAwait());
#else

Assert.ThrowsAsync<TaskCanceledException>(async () => await Task.WhenAll(task1, task2).CfAwait());
#endif


await Task.Delay(100, CancellationToken.None).CfAwait();

Expand Down

0 comments on commit 9bc197a

Please sign in to comment.