Skip to content

Commit

Permalink
Revert
Browse files Browse the repository at this point in the history
  • Loading branch information
tmat committed Nov 9, 2024
1 parent 6219220 commit 7075af6
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions test/dotnet-watch.Tests/HotReload/RuntimeProcessLauncherTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,32 @@ public enum TriggerEvent
WaitingForChanges,
}

private async Task<TestAsset> CopyTestAsset(string assetName, params object[] testParameters)
private Task<TestAsset> CopyTestAsset(string assetName, params object[] testParameters)
{
var testAsset = TestAssets.CopyTestAsset("WatchAppMultiProc", identifier: string.Join(";", testParameters))
.WithSource();

var dir = testAsset.Path;
var testDir = Path.Combine(dir, ".test");
using var watcher = new EventBasedDirectoryWatcher(dir);
var completion = new TaskCompletionSource();

watcher.OnFileChange += (_, arg) =>
{
if (arg.filePath == testDir)
{
completion.TrySetResult();
}
else
{
Log($"[TEST] File system event drained: {arg.kind} {arg.filePath}");
}
};

watcher.EnableRaisingEvents = true;
Directory.CreateDirectory(testDir);
await completion.Task;
return testAsset;
//var dir = testAsset.Path;
//var testDir = Path.Combine(dir, ".test");
//using var watcher = new EventBasedDirectoryWatcher(dir);
//var completion = new TaskCompletionSource();

//watcher.OnFileChange += (_, arg) =>
//{
// if (arg.filePath == testDir)
// {
// completion.TrySetResult();
// }
// else
// {
// Log($"[TEST] File system event drained: {arg.kind} {arg.filePath}");
// }
//};

//watcher.EnableRaisingEvents = true;
//Directory.CreateDirectory(testDir);
//await completion.Task;
return Task.FromResult(testAsset);
}

private static async Task<RunningProject> Launch(string projectPath, TestRuntimeProcessLauncher service, string workingDirectory, CancellationToken cancellationToken)
Expand Down

0 comments on commit 7075af6

Please sign in to comment.