Javascript and Typescript tests sometimes fail

I have two exercises (one in javascript, one in typescript) that run locally but do no not run on exercism (timeout without reference on which test is failing).

How can I best troubleshoot those two exercises? I am also wondering why it does not tell me which test fails.

  1. JS - Perfect Numbers
  2. TS - Darts

What is the best way to troubleshoot? Should I share my code here? Before completing the mentoring session, I believe I cannot publish the exercise.

Thank you very much!

1 Like

Timeouts aren’t managed on a per-test basis. Exercism runs all the tests in a Docker container. The results of all tests are recorded. If the entire test suite doesn’t complete in time, the test execution is stopped. There’s no way to know which tests are complete or in middle of running when that happens.

Alas, on some tracks getting Docker up and running can take a big chunk of the available time.

How long does it take to run the tests?

If it’s is repeatable, you can share your code here. It could also be transient if the servers are heavily loaded.

2 Likes

You can mark an exercise complete and publish it at any point without affecting a mentoring request or session in progress. Mentoring is purely voluntary in Exercism v3, and you can request it at any time once you have an iteration submitted. You can even request mentoring for an exercise already marked complete.

1 Like

Thank you very much. Here is the link to my JS problem

  1. JS - Perfect Numbers

The TypeScript tests decided to run all green today :-)

In your for loop, how often is Math.floor(n / 2) evaluated?

Good point, thank you very much. But why does the test runner not tell me which test(s) is/are failing and just report an arbitrary message? Also, the tests run fine and fast on my local machine. Any ideas why this is the case?

If a test had failed, the test runner should stop and report that failure. However, in this situation, there are no tests failing, up to and including the test causing the time-out. The test runner simply ran out of its allocated time before it couldn’t report the results.