Skip to content

Commit c0e3a59

Browse files
committed
adding a couple await Task.Delay(500); to test in order to resolve flaky tests
1 parent 65db66b commit c0e3a59

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/ElectronNET.IntegrationTests/Tests/AutoUpdaterTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ public async Task RequestHeadersAsync_check()
104104
var test = await Electron.AutoUpdater.RequestHeadersAsync;
105105
test.Should().BeNull();
106106
Electron.AutoUpdater.RequestHeaders = headers;
107+
await Task.Delay(500);
107108
test = await Electron.AutoUpdater.RequestHeadersAsync;
108109
test.Should().NotBeNull();
109110
test.Count.Should().Be(1);

src/ElectronNET.IntegrationTests/Tests/WebContentsTests.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,23 +132,25 @@ public async Task DevTools_check()
132132
Skip.If(Environment.GetEnvironmentVariable("GITHUB_RUN_ID") != null, "Skipping test in CI environment.");
133133
fx.MainWindow.WebContents.IsDevToolsOpened().Should().BeFalse();
134134
fx.MainWindow.WebContents.OpenDevTools();
135-
await Task.Delay(1000);
135+
await Task.Delay(500);
136136
fx.MainWindow.WebContents.IsDevToolsOpened().Should().BeTrue();
137137
fx.MainWindow.WebContents.CloseDevTools();
138-
await Task.Delay(1000);
138+
await Task.Delay(500);
139139
fx.MainWindow.WebContents.IsDevToolsOpened().Should().BeFalse();
140140
fx.MainWindow.WebContents.ToggleDevTools();
141-
await Task.Delay(1000);
141+
await Task.Delay(500);
142142
fx.MainWindow.WebContents.IsDevToolsOpened().Should().BeTrue();
143143
}
144144

145145
[Fact(Timeout = 20000)]
146146
public async Task GetSetAudioMuted_check()
147147
{
148148
fx.MainWindow.WebContents.SetAudioMuted(true);
149+
await Task.Delay(500);
149150
var ok = await fx.MainWindow.WebContents.IsAudioMutedAsync();
150151
ok.Should().BeTrue();
151152
fx.MainWindow.WebContents.SetAudioMuted(false);
153+
await Task.Delay(500);
152154
ok = await fx.MainWindow.WebContents.IsAudioMutedAsync();
153155
ok.Should().BeFalse();
154156

0 commit comments

Comments
 (0)