public static async Task OneTimeSetup() { var lockFileInfo = Directories.TempDirectory.CreateFileInfoInDirectory("test.lock"); lockFile?.DisposeAndDeleteFile(); lockFile = await LockedFile.CreateAsync(lockFileInfo, TimeSpan.FromSeconds(60)) .ConfigureAwait(false); }
public async Task OneTimeSetup() { var lockFileInfo = Directories.TempDirectory.CreateFileInfoInDirectory("test.lock"); try { lockFileInfo.Delete(); } catch { // this could happen if the previous run was stopped in the debugger. } // using this because AppVeyor uses two workers for running the tests. this.lockFile?.Dispose(); this.lockFile = await LockedFile.CreateAsync(lockFileInfo, TimeSpan.FromSeconds(60)) .ConfigureAwait(false); }