Unable to pass one of the tests in Exercise Tracker project

The following test times-out:

You can add from, to and limit parameters to a GET /api/users/:_id/logs request to retrieve part of the log of any user. from and to are dates in yyyy-mm-dd format. limit is an integer of how many logs to send back. (Test timed out)

However, when I test the GET request, it works as expected. Here is a link to my code: boilerplate-project-exercisetracker - Replit

Can someone help me out?

–UPDATE–

I have done the following things and still can’t find the solution:

  • Changed the timezone of the computer to match UTC timezone.
  • Used Tor browser to confirm that timezone may not be the issue.
  • Logged all the inputs and outputs.
  • Changed the database cluster location.

Another interesting thing that I found was that when I submitted someone else’s work (just to check if it works), it ran successfully but when I put in my MongoDB URI, that same code failed for the same test. Could it be that the response times for my cluster is too slow and hence the test times-out?

I have also been facing the same issues with my code’s last test. I am guessing, it maybe due to poor internet speed / bandwidth as all my output GET POST is same as the sample showcased in “exercise-tracker.freecodecamp.rocks”

“Test timed out” seems to happen to other tests too if the speed is very low.
I will try to run this code in another system and see what happens although ,I did not face any problems in the other projects which is strange.

Also, some time/ date mismatch happens for me after midnight despite keeping things in UTC, still causing the second last test to also fail which resolves after like 6 in the morning.

I don’t think internet speed is my problem. Also, I believe that the date-time mismatch also is unlikely to be the problem as all other tests pass. Maybe something to do with database querying speeds?

UPDATE:

I have tried using a different system with higher internet speeds but it did not make any difference.

After hours of struggling, I have finally set up my local server and ran the code locally on Visual Studio Code which has given very strange results.
Sometimes all the test passes, sometimes some tests fail.
It just appears to randomly pass and fail tests - especially the logs related tests.

I have tried clearing the Mongo Database, which sometimes causes all the tests to pass.

Is version of document also matched during log searching query?
I get the following error:
"’’’
Unexpected error undefined:

VersionError: No matching document found for id “62ad96d9d0070d2a818423db” version 0 modifiedPaths “count, exercise”
Process exited with code 1

“”"
The above document exists, but the version is different.

you can try on your mobile phone, when I was doing timestamp project it did not pass on my pc but on my mobile passed flawlessly

Doesn’t work for me :frowning_face:

I know the pain, the backend projects are not difficult but configurations and test cases suck, they don’t pass or mongodb connection problem I learned hard way

UPDATE:

The problem seems to be with Replit servers.

After exporting data to Github and running it via Gitpod, all tests have passed.
I believe the issue is because the project’s verification script has a timeout set a bit low
causing random test bits to fail with Time Out Error during I guess heavy server traffic.

Yes! I ran the project using Gitpod and the tests have passed! Thank you so much!

1 Like