Pomodoro tests timeout - Timeout of 5000ms exceeded - Example fails tests as well

I get this error on tests #1, #12-15 of #Timer and #1 of #Audio.

Timeout of 5000ms exceeded. For async tests and hooks, ensure “done()” is called; if returning a Promise, ensure it resolves.
Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure “done()” is called; if returning a Promise, ensure it resolves.
at o.f._timeoutError (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:570:32569)
at https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:570:30700

The clock works as it’s supposed to but I still fail these tests. Any help would be appreciated!

Note: I know similar topics exist in this forum but they didn’t help me solve my problem

UPDATE: The tests fail even on the example, so there is definitely something wrong with the tests…

I found this: https://github.com/freeCodeCamp/testable-projects-fcc/issues/515 , which states that this bug is on the “to-do list” to be fixed at some point. Should I submit my solution or is there something missing in my code(apart from the sound last more than 1 second) ?

This is so weird. The sound plays for me. Maybe it’s the browser’s fault… I really don’t know what to do right now and I can’t force anyone to thoroughly look into code…

I’m using Chrome Version 69.0.3497.100
I’m failing 3 more tests but I get the same error message in all of them so maybe it’s the same problem.
If you want to verify my Pen works you can set both the session and the break length to 1 minute and run the timer.

I reworked it a little bit. Before setInterval would always run depsite it not updating anything, now I clear it and set up a new one. Now when the test run my version behaves more like the example. However, the timeout errors still exist and I’m now getting this in the console:

Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause().

Any thoughts? (Also, did you get the change to work on the Pomodoro Clock yourself like you said?)

Hi, I just had the same problem and it had to do with the fact that when either the minutes or seconds are less than 10, the Date object doesn’t show the “0” before the digit. So “9” instead of “09” for instance.

I think it is important that the clock always shows 4 digits “XX:XX” or it could mess up some of the logic.
I did this by adding conditionals for each minutes and seconds.

Hope this helps.

I have accounted for this and still get the error. From what I’ve gathered it’s probably due to bad timing of the sound and/or having 1 extra second during each switch.

I found this:

So, since everything, including the timing of the sound behaves like the example, should I submit my Pen despite it not passing all the tests?

I also finished that project today, same issue, everything seems to work properly. I bet that this is related to usage of setInterval(), any idea how to resolve it?

Regards.

Alright. I managed to solve this problem. In my case, I forgot to clearInterval() also in my reset function. Keep that in mind :wink:

Regards.

This didn’t work for me…:sob:

If you want, u can check my repo here : https://github.com/burzychsd/FCC_PomodoroClock/blob/master/src/containers/App.js

I know it’s frustrating, even when the project works, u may still noticed sth and solve why it still not passing these tests. :wink:

Thanks but I feel like that’s kind of cheating to be honest. I really want to figure this out (semi-)myself

Fair enough :wink: But if you would like some help with it, reach out to me via email (I’m not seeing here a ‘private message’ option ) - burzychs@gmail.com

If you click my name there is an option of “Message”

Sry for spam people, but GiaFill007 - I might be blind, I dont see that option, write to me first then on fcc, I will try to help :wink:

I feel you, I think we all do, but If you want some help with this u can reach out to me on discord if u have account there ( @Burzychs ) or via email <removed by moderator> - I’ll be glad to help :wink:

i tried adding u but it needs 4 digit no. as well.
I am also having some trouble with clock project.

I finally got it!!! For some reason CodePen when you press Tidy JS injects a space on text so this:

<h1 id={this.props.id}>
          {this.state.minutes}:{this.state.seconds}
 </h1>

became this:

const time = this.state.minutes + ":" + this.state.seconds;

<h1 id={this.props.id}>{time}</h1>

Also, this:
if (this.state.minutes === "00" && this.state.seconds === "00") {
became this:
if (this.state.minutes === "00" && this.state.seconds === "01") {
Can’t believe it was CodePen’s fault all along…

great work. congrats