Skip to content

Commit 4e3d395

Browse files
committed
TestNewerDotnetVersionAssembly done
1 parent 3e48c32 commit 4e3d395

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

modules/platforms/dotnet/Apache.Ignite.Tests/Compute/DotNetJobs.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,15 @@ public static class DotNetJobs
4545

4646
public static async Task<string> WriteNewerDotnetJobsAssembly(string tempDirPath, string asmName)
4747
{
48-
var targetPath = Path.Combine(tempDirPath, asmName + ".dll");
48+
var targetFile = Path.Combine(tempDirPath, asmName + ".dll");
49+
50+
await using var fileStream = File.Create(targetFile);
4951

5052
await Assembly.GetExecutingAssembly()
5153
.GetManifestResourceStream("Apache.Ignite.Tests.Compute.Executor.NewerDotnetJobs.NewerDotnetJobs.dll")!
52-
.CopyToAsync(File.Create(targetPath));
54+
.CopyToAsync(fileStream);
5355

54-
return targetPath;
56+
return targetFile;
5557
}
5658

5759
public class AddOneJob : IComputeJob<int, int>

modules/platforms/dotnet/Apache.Ignite.Tests/Compute/PlatformComputeTests.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,16 @@ public async Task TestPlatformExecutorWithOldServerThrowsCompatibilityError()
288288
}
289289

290290
[Test]
291-
public async Task TestNewerDotnetVersionAssembly()
291+
public void TestNewerDotnetVersionAssembly()
292292
{
293-
await ExecJobAsync(DotNetJobs.NewerDotNetJob, "test");
293+
var ex = Assert.ThrowsAsync<IgniteException>(async() => await ExecJobAsync(DotNetJobs.NewerDotNetJob, "test"));
294+
295+
StringAssert.StartsWith(
296+
".NET job failed: Failed to load type 'NewerDotnetJobs.EchoJob, NewerDotnetJobs' " +
297+
"because it depends on a newer .NET runtime version (required: 10, current: 8",
298+
ex.Message);
299+
300+
Assert.AreEqual("IGN-COMPUTE-9", ex.CodeAsString);
294301
}
295302

296303
private async Task<IClusterNode> GetClusterNodeAsync(string? suffix = null)

0 commit comments

Comments
 (0)