exercism/powershell

Failing CI for Windows 2022

Closed this issue · 1 comments

CI fails on the Rest API exercise for the windows-2022 target.

Starting discovery in 1 files.
Discovery found 10 tests in 8ms.
Running tests.
Error: [-] RestApi test cases.iou -> borrower has negative balance 26ms (25ms|1ms)
Message
  Expected strings to be the same, but they were different.
  String lengths are both 304.
  Strings differ at index 225.
  Expected: '...n      "balance": -6.0,\r\n      "name": "Bob",\r\n      "owes": {\r\n        "Chuck": 3.0,\r\n  ...'
  But was:  '...n      "balance": -6.0,\r\n      "name": "Bob",\r\n      "owes": {\r\n        "Adam": 3.0,\r\n   ...'
  ----------------------------------------------------------------------------------^
  at ($got | ConvertTo-Json -Depth 5) | Should -BeExactly ($want | ConvertTo-Json -Depth 5), C:\Users\runneradmin\AppData\Local\Temp\rest-api\RestApi.tests.ps1:93
  at <ScriptBlock>, C:\Users\runneradmin\AppData\Local\Temp\rest-api\RestApi.tests.ps1:93
Tests completed in 183ms
Tests Passed: 9, Failed: 1, Skipped: 0, Inconclusive: 0, NotRun: 0

Yeah there is a small issue with that exercise, due to the way json object got convert back and forth by powershell, sometimes (I legit think it is 50-50 in this case) the order will came out wrong and failed the test, but then you re-run the failed test (never have to re-run more than twice) and it randomly pass.
It wasn't a big issue before so I just kinda let it slide because I know there was nothing technically wrong.
If this keeping popping up over and over I might consider skipping that one specific test or change it to prevent the error.
For now it is resolved after a rerun in this PR.