adding a couple await Task.Delay(500); to test in order to resolve flaky tests

This commit is contained in:
agracio
2025-12-04 19:26:24 +00:00
parent 65db66b4e9
commit c0e3a595c3
2 changed files with 6 additions and 3 deletions

View File

@@ -104,6 +104,7 @@
var test = await Electron.AutoUpdater.RequestHeadersAsync;
test.Should().BeNull();
Electron.AutoUpdater.RequestHeaders = headers;
await Task.Delay(500);
test = await Electron.AutoUpdater.RequestHeadersAsync;
test.Should().NotBeNull();
test.Count.Should().Be(1);

View File

@@ -132,13 +132,13 @@ namespace ElectronNET.IntegrationTests.Tests
Skip.If(Environment.GetEnvironmentVariable("GITHUB_RUN_ID") != null, "Skipping test in CI environment.");
fx.MainWindow.WebContents.IsDevToolsOpened().Should().BeFalse();
fx.MainWindow.WebContents.OpenDevTools();
await Task.Delay(1000);
await Task.Delay(500);
fx.MainWindow.WebContents.IsDevToolsOpened().Should().BeTrue();
fx.MainWindow.WebContents.CloseDevTools();
await Task.Delay(1000);
await Task.Delay(500);
fx.MainWindow.WebContents.IsDevToolsOpened().Should().BeFalse();
fx.MainWindow.WebContents.ToggleDevTools();
await Task.Delay(1000);
await Task.Delay(500);
fx.MainWindow.WebContents.IsDevToolsOpened().Should().BeTrue();
}
@@ -146,9 +146,11 @@ namespace ElectronNET.IntegrationTests.Tests
public async Task GetSetAudioMuted_check()
{
fx.MainWindow.WebContents.SetAudioMuted(true);
await Task.Delay(500);
var ok = await fx.MainWindow.WebContents.IsAudioMutedAsync();
ok.Should().BeTrue();
fx.MainWindow.WebContents.SetAudioMuted(false);
await Task.Delay(500);
ok = await fx.MainWindow.WebContents.IsAudioMutedAsync();
ok.Should().BeFalse();