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

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

#1

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…


#2

If that is the case, would you mind opening an issue on Github if there is not already an outstanding issue for this problem?


#3

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) ?


#4

What is interesting is when the tests run with your code, I never even hear the sounds (regardless of how long they are).

FYI - I just ran the test suite on the demo Pomodoro Clock and passed all 29 tests and hear the sounds.

Also, the Github issue you reference has not been assigned to anyone, so it has not been confirmed that it is an actual issue with the test suite. I would have to study your code more to validate what the issue is. The tests are working fine on the demo project, so I assume the tests are correct unless someone attached to the issue says otherwise.


#5

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…


#6

What browser are you using, so I can try and test yours with it?

And you are sure the exact same tests fail with the demo project?


#7

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.


#8

I guess it is time for me to sit down and do this project myself and see if I have trouble. I will work on this today/tomorrow and if I can get my version to pass, I will examine your code and compare it to mine.


#9

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?)


#10

No sorry. I started on it and then life got in the way. I am working on a personal project which I will hopefully finish this week. It has consumed me.


#11

A post was split to a new topic: Pomodoro tests timeout issue


#12

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.


#13

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.


#14

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?


#15

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.


#16

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.


#17

This didn’t work for me…:sob:


#18

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:


#19

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


#20

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 ) - [email protected]