Skip to content

Commit 0caa4a7

Browse files
committed
Fixing flaky test
1 parent 900d1a6 commit 0caa4a7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/WebJobs.Script.Tests/ScriptHostTests.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,13 @@ public async Task OnDebugModeFileChanged_TriggeredWhenDebugFileUpdated()
122122
File.WriteAllText(debugSentinelFilePath, string.Empty);
123123
}
124124

125-
host.LastDebugNotify = DateTime.MinValue;
125+
// first put the host into a non-debug state
126+
await TestHelpers.Await(() =>
127+
{
128+
host.LastDebugNotify = DateTime.MinValue;
129+
return !host.InDebugMode;
130+
});
131+
126132
Assert.False(host.InDebugMode, $"Expected InDebugMode to be false. Now: {DateTime.UtcNow}; Sentinel LastWriteTime: {File.GetLastWriteTimeUtc(debugSentinelFilePath)}; LastDebugNotify: {host.LastDebugNotify}.");
127133

128134
// verify that our file watcher for the debug sentinel file is configured

0 commit comments

Comments
 (0)