Did somebody pass Number Guessing Game?

Tell us what’s happening:
Hello,

I finished the project, but when the CodeRoad give me always different checkmarks. I saw is a common issue but I didn’t find the solution.

Who could help me?

THANK A MILLION



!

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36

Challenge: Number Guessing Game - Build a Number Guessing Game

Link to the challenge:

Hi there,

I also face this issue, have been restarting the VM & re-run the test several times but still no luck.

The same code works fine and passed completely when I tested it locally via Docker & VSCode…

So here I am, also confused :sweat_smile: and waiting for any reply from admin…

Hello!

I had a similar issue HERE.

I tried also for this last step but nothing.

Hope for same help :slight_smile:

It seems that we should just keep trying to clear our own browser history, restart the VM & re-run the test. As long as our code already fulfilled all the requirements, later somehow it would successfully pass. Just now I tried again without changing the code, and after several clicks on ‘Run’, it did pass! :tada:

Thank you!

Right now is impossible to use codeAlly, I’ll try later.

Could I ask which browser did you use and how many attempts did you need?

Thank you a million!

Yes of course,

browser is Chrome version 113.0.5672.93 (Official Build) (64-bit). Have attempted about 5 times each in 2 last days (13 & 14 May).

If possible, perhaps you could try doing it in your local (via Docker & VSCode) first (see the tutorial: Relational Database Course – How to Learn SQL in VSCode Using Docker and freeCodeCamp), just to check whether your code can successfully pass the test or not…

Good luck!

Hi @jenniferlorenza0307. I am having the same issue here. I have gotten all tests to pass, however just not all at once. Clearing my history and restarting the VM does not appear to help. Any other suggestions?

I have managed to pass this in the last few days. I don’t know whether I just got lucky or whether it was the tinkering I did with the test files.

However, looking at the test output messages and then trying adjusting the timeout and also the buffer size, I then passed all tests immediately.

If you have code which should be passing but isn’t, share it with me and I’ll see if I can get it to pass and then I can let you know how I did it (if I succeed).

I used this again and worked after several (8-10) attempts!

Oh great - glad it worked!

1 Like

How do we change the timeouts within the editor?

This helpful post explains how you can use a sed command in the terminal to adjust the timeout in the utils.js file:

1 Like

@igorgetmeabrain Do you recall what changes you made to the buffer size?

Thanks @igorgetmeabrain for the link. I have increased the timeout however the tests still appear to fail at random

If you’re getting ‘max buffer exceeded’ error messages in the test output, you could try increasing the buffer size by inserting {maxBuffer: 1024 * 500} in place of the empty curly brackets in the utils.js file here:
Untitled

Also highlighted is a timeout which can be increased if you’re getting child process errors. Set to 1000 initially, but here I increased it to 10000.

Hi there. How do I locate the test output messages?

Thanks for that. After making those two changes to utils.js, I still occasionally (maybe not as frequently) get “maxBuffer length exceeded” errors. Should I keep futzing with those values?

I do consistently get at least a few of the more generic Command failed: ./number_guessing_game/number_guess.sh errors, like so:

  ✘ SUBTASKS 1.1 :8 Your script should print the correct welcome message for returning users

Error: Command failed: ./number_guessing_game/number_guess.sh

at ChildProcess.exithandler (child_process.js:383:12)
at maybeClose (internal/child_process.js:1058:16)
at Socket.<anonymous> (internal/child_process.js:443:11)
at Pipe.<anonymous> (net.js:686:12)

Do you have any insight into what’s causing this particular error? Those four “at” lines at the bottom are identical between each instance of a subtask failing because of Error: Command failed.

I should also mention that I did follow @jenniferlorenza0307’s example and ran my code locally with no issues.

How do I locate the test output messages?

  1. In a Terminal panel, click on the “OUTPUT” tab
  2. In the dropdown menu, select “CodeRoad (Tests)” (it’s set to “Tasks” by default)

I don’t know these courses are running slowly and erratically (perhaps a capacity issue), but it means that tests appear to be failing for a variety of reasons to do with the speed/stability of the environment.

It’s a bit hit and miss, but I found increasing the buffer size mitigated against the max buffer error, whilst increasing timeouts before the child process is killed seemed to help with child process related warnings (increasing the timeouts in the same code block in both utils.js and 1.1.test.js). Also, when I was getting a 20000ms timeout warning, that seemed to relate to the default Mocha timeout, as when I adjusted that in package.json, the error disappeared and the project passed.

So I guess it depends if there are particular errors which are persistently present.
I you want to PM me your sql and sh files I’m happy to run them and see if I can get them to pass (without having to spam the Run button).

Hello,

I’ve been stuck with this last challenge for the same reason of getting different check-marks, I’ve created this post with links to my bash script and sql dump in case somebody wants to help me out.

I tried changing timeouts to see if that could work but it didn’t, i also checked some of the regexp in test file but i really don’t understand why it does not pass.

Any help would be really appreciated.