Skip to content

Commit

Permalink
Merged Pull Request '#57 postindustria-tech:sleep-for-logging-to-happ…
Browse files Browse the repository at this point in the history
…en->main : 'Failed DataUpdateService_UpdateFromUrl_HttpException''

Failed DataUpdateService_UpdateFromUrl_HttpException
  • Loading branch information
Automation51D authored Sep 23, 2023
2 parents 4a9cbf4 + 4fd2d18 commit fe0242f
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class DataUpdateServiceTests
private int _ignoreWranings = 0;
private int _ignoreErrors = 0;
private const int TEST_TIMEOUT_MS = 3000;
private const int LOGGING_TIMEOUT_MS = 75;

private DataUpdateService _dataUpdate;

Expand Down Expand Up @@ -101,8 +102,18 @@ public void Init()
[TestCleanup]
public void Cleanup()
{
_logger.AssertMaxErrors(_ignoreErrors);
_logger.AssertMaxWarnings(_ignoreWranings);
try
{
_logger.AssertMaxErrors(_ignoreErrors);
_logger.AssertMaxWarnings(_ignoreWranings);
}
finally
{
foreach (var entry in _logger.Entries)
{
Console.WriteLine($"[LOGGER LOGS] {entry.Key} > {entry.Value}");
}
}
}

/// <summary>
Expand Down Expand Up @@ -890,6 +901,7 @@ public void DataUpdateService_UpdateFromUrl_HttpException()
// Assert
Assert.IsTrue(completeFlag.IsSet, "The 'CheckForUpdateComplete' " +
"event was never fired");
Thread.Sleep(LOGGING_TIMEOUT_MS);
_httpHandler.Verify(h => h.Send(It.IsAny<HttpRequestMessage>()), Times.Once());
// Make sure engine was not refreshed
engine.Verify(e => e.RefreshData(config.Identifier), Times.Never());
Expand Down

0 comments on commit fe0242f

Please sign in to comment.