-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* debugging * reset comented out code and scope tests only to memory leak * simulate a machine with precompute * Fixed multiple memry leaks Fixed the CI issue * put the netstandard tests back * update the precompute tests * bump version to 1.91.9 * move helpers to their own file * It doesn't matter, but still --------- Co-authored-by: AddressXception <github@addressxception.com> Co-authored-by: John Morgan <john.morgan@infernored.com>
- Loading branch information
1 parent
6c5f003
commit 196c90a
Showing
11 changed files
with
227 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
bindings/netstandard/ElectionGuard/ElectionGuard.Encryption.Tests/Helpers.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System; | ||
using System.Diagnostics; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using NUnit.Framework; | ||
|
||
namespace ElectionGuard.Encryption.Tests | ||
{ | ||
|
||
public static class TestHelpers | ||
{ | ||
public static async Task RunForAsync(TimeSpan duration) | ||
{ | ||
var start = DateTime.Now; | ||
var end = start + duration; | ||
while (DateTime.Now < end) | ||
{ | ||
PrintMemory(); | ||
await Task.Delay(1000); | ||
} | ||
} | ||
|
||
public static void RunFor(TimeSpan duration) | ||
{ | ||
var start = DateTime.Now; | ||
var end = start + duration; | ||
while (DateTime.Now < end) | ||
{ | ||
PrintMemory(); | ||
Thread.Sleep(1000); | ||
} | ||
} | ||
|
||
public static void PrintMemory() | ||
{ | ||
var currentProcess = Process.GetCurrentProcess(); | ||
var workingSet = currentProcess.WorkingSet64; | ||
Console.WriteLine($"Memory Size: {workingSet / (1024.0 * 1024.0):F2} MB"); | ||
} | ||
} | ||
} |
26 changes: 22 additions & 4 deletions
26
bindings/netstandard/ElectionGuard/ElectionGuard.Encryption.Tests/TestEncrypt.cs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.