Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
974: tests: Fix Network.Wai.Middleware.LoggingSpec on Windows r=KtorZ a=rvl Relates to #703. # Overview ``` test/unit/Network/Wai/Middleware/LoggingSpec.hs:109:5: 9) Network.Wai.Middleware.Logging, Logging Middleware, GET, 200, no query uncaught exception: IOException of type UserError user error (Expected exactly 3 log entries but got 1: [LogObject {loName = "request-0", loMeta = LOMeta {tstamp = 2019-11-05 04:43:05.8652477 UTC, tid = "ThreadId 13863", severity = Info, privacy = Public}, loContent = LogMessage "[GET] /get"}]) To rerun use: --match "/Network.Wai.Middleware.Logging/Logging Middleware/GET, 200, no query/" test/unit/Network/Wai/Middleware/LoggingSpec.hs:117:5: 10) Network.Wai.Middleware.Logging, Logging Middleware, GET, 200, with query uncaught exception: IOException of type UserError user error (Expected exactly 3 log entries but got 5: [LogObject {loName = "request-0", loMeta = LOMeta {tstamp = 2019-11-05 04:43:05.8652477 UTC, tid = "ThreadId 13863", severity = Info, privacy = Public}, loContent = LogMessage "200 OK in 0s"},LogObject {loName = "request-0", loMeta = LOMeta {tstamp = 2019-11-05 04:43:05.8652477 UTC, tid = "ThreadId 13863", severity = Debug, privacy = Public}, loContent = LogMessage "14"},LogObject {loName = "request-1", loMeta = LOMeta {tstamp = 2019-11-05 04:43:05.8652477 UTC, tid = "ThreadId 13863", severity = Info, privacy = Public}, loContent = LogMessage "[GET] /get?query=patate"},LogObject {loName = "request-1", loMeta = LOMeta {tstamp = 2019-11-05 04:43:05.8652477 UTC, tid = "ThreadId 13863", severity = Info, privacy = Public}, loContent = LogMessage "200 OK in 0s"},LogObject {loName = "request-1", loMeta = LOMeta {tstamp = 2019-11-05 04:43:05.8652477 UTC, tid = "ThreadId 13863", severity = Debug, privacy = Public}, loContent = LogMessage "14"}]) To rerun use: --match "/Network.Wai.Middleware.Logging/Logging Middleware/GET, 200, with query/" test/unit/Network/Wai/Middleware/LoggingSpec.hs:184:13: 11) Network.Wai.Middleware.Logging, Logging Middleware, different request ids Falsifiable (after 4 tests and 6 shrinks): NumberOfRequests 1 expected: 1 but got: 48 To rerun use: --match "/Network.Wai.Middleware.Logging/Logging Middleware/different request ids/" test/unit/Network/Wai/Middleware/LoggingSpec.hs:198:13: 12) Network.Wai.Middleware.Logging, Logging Middleware, correct time measures Falsifiable (after 1 test): (NumberOfRequests 5,RandomIndex 1) expected: 1 but got: 0 To rerun use: --match "/Network.Wai.Middleware.Logging/Logging Middleware/correct time measures/" Randomized with seed 534946986 Finished in 629.7711 seconds 915 examples, 12 failures, 1 pending C:\Users\win\cw> ``` - This "fixes" the tests on windows. - "different request ids" test still fails # Comments It seems like iohk-monitoring writes its logs asynchronously. Or there is some other race condition with the TVar containing log messages. Co-authored-by: Rodney Lorrimar <[email protected]>
- Loading branch information