"All tests passed" but one test shows up as both passed and failed

Suspected bug in exercism website, odin track

problem

In the odin/bank-account exersize, all 17 tests show up as passed in the browser as well as locally and I am able to submit the solution.

However:

  • test #17 (“test_can_handle_concurrent_transactions” which tests concurrency if that helps) shows up as passed in the passed section and ALSO as failed in the failed tests section
  • Under the failed section, it is also labled as test #18 (which doesn’t exist; I counted many times).
  • The name and source code of the test are exactly the same as test #17 (which passes).

images

  1. all tests passed, but one appears as failed

  2. test #17 and #18 are duplicates
    (sorry it only lets me add one media attachment)

conclusion

This doesn’t inhibit my use of the website in any way, as I can still submit my solution but is very confusing and unexpected. I didn’t find any information searching google or the forum, and the issue persists through reloading the page. It also had me debugging my working code for quite some time. Any help would be apprecated!

Could you share the code you’re using?

All the test cases should be unique.

I count 17 sets of @(test) and testing.expect_value.

I see this issue when I run the example solution as well. The test 17 that does passes has no associated “code run” section. The test 17 that does fails does show the code run, but notably the test failure message simply says “unknown”. I suspect it’s an issue with the reporting setup, but I don’t see it on some other exercises I tried.

Seems like the test runner has a bug parsing this test suite.

Here is a link to my published solution

The test runner dupes the last test. From results.json:

  {
    "name": "Can handle concurrent transactions",
    "status": "pass"
  },
  {
    "name": "Can handle concurrent transactions",
    "message": "unknown",
    "status": "fail",
    "test_code": "account: Account\nopen(&account)\nN :: 500\nDEPOSIT_PER_THREAD :: 19\nWITHDRAW_PER_THREAD :: 5\nNET_GAIN :: (DEPOSIT_PER_THREAD - WITHDRAW_PER_THREAD) * N\naccount := (^Account)(t.data)\ndeposit(account, DEPOSIT_PER_THREAD)\nwithdraw(account, WITHDRAW_PER_THREAD)\n}\nworkers := make([]^thread.Thread, N)\ndefer delete(workers)\nfor &w in workers {\nw = thread.create(deposit_then_withdraw)\nw.data = &account\n}\ndefer for w in workers {\nthread.destroy(w)\n}\nfor w in workers {\nthread.start(w)\n}\nthread.join_multiple(..workers)\namount, _ := read_balance(&account)\ntesting.expect_value(t, amount, NET_GAIN)"
  }

In the test runner’s run.sh the read_test_file function is failing to populate test_code for that test. But odin_test_results is set to true for that test. I suspect this causes it to show up once in the success list and once in the failure list.

Without spending too much time on it, I suspect the nested { ... } handling inside test code is broken.

1 Like