From eaf5db5e91be356627161747d5ae7d2c9be94825 Mon Sep 17 00:00:00 2001 From: benbierens Date: Tue, 8 Aug 2023 10:45:16 +0200 Subject: [PATCH] Run test against increasing file sizes --- DistTestCore/ByteSize.cs | 10 ++++++++++ Tests/BasicTests/ContinuousSubstitute.cs | 6 +++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/DistTestCore/ByteSize.cs b/DistTestCore/ByteSize.cs index 8d47cf25..bbf01cc3 100644 --- a/DistTestCore/ByteSize.cs +++ b/DistTestCore/ByteSize.cs @@ -38,6 +38,11 @@ namespace DistTestCore { private const long Kilo = 1024; + public static ByteSize Bytes(this long i) + { + return new ByteSize(i); + } + public static ByteSize KB(this long i) { return new ByteSize(i * Kilo); @@ -58,6 +63,11 @@ namespace DistTestCore return (i * Kilo).GB(); } + public static ByteSize Bytes(this int i) + { + return new ByteSize(i); + } + public static ByteSize KB(this int i) { return Convert.ToInt64(i).KB(); diff --git a/Tests/BasicTests/ContinuousSubstitute.cs b/Tests/BasicTests/ContinuousSubstitute.cs index 324b3d78..ff606efa 100644 --- a/Tests/BasicTests/ContinuousSubstitute.cs +++ b/Tests/BasicTests/ContinuousSubstitute.cs @@ -61,17 +61,21 @@ namespace Tests.BasicTests } } + private ByteSize fileSize = 10.MB(); + private void PerformTest(IOnlineCodexNode primary, IOnlineCodexNode secondary) { ScopedTestFiles(() => { - var testFile = GenerateTestFile(1000.MB()); + var testFile = GenerateTestFile(fileSize); var contentId = primary.UploadFile(testFile); var downloadedFile = secondary.DownloadContent(contentId); testFile.AssertIsEqual(downloadedFile); + + fileSize = (fileSize.SizeInBytes * 2).Bytes(); }); } }