6 kyu
I Promise Not To Optimize
1,716dcsmith
Loading description...
Promises
Asynchronous
Fundamentals
View
Career Accelerator
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
No tests, you can only try your solutions with attempts. More, same attempts one time may not pass due to CodeWars 12 seconds time exceed when other time be successful.
no sample tests
Nice kata, it made me remember Date object
How the hell did I pass this. xD
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
Tests fail now regardless of the number of ms you set on the timeout. This kata seems impossible to pass anymore and as such should either be changed immediately or retired.
It works with node v8 selected.
Kinda. It works, but only when you don't follow the description and set the timeout to some arbitrary value that correlates with the hidden tests. Not really what I'd expect but meh
Hmm, I can see your current code, and judging by it, I don't think you fully understood the task. What you need to factor in is that
task
can take any amount of time, so guessing this period is incorrect strategy. Your code should work whether the task runs for 5ms, or 5000ms, that's part of the challenge.Oh, I didn't notice you actually passed the kata. That's really bad testing then :/
So this kata is possible, and as such I will close the issue. There should be a new issue(s) raised, but I don't know how to formulate that quite yet... The testing method is strange :P
Nice kata !
A couple of issues:
the second issue is invalid. the kata is still solvable as of 2023; the Codewars' timeout limit is still
12 000 ms
. Read the description carefully:You have to take into account the task's execution time in your delaying.
A couple issues:
It doesn't look like this kata verifies that the function executes in the specified time window (my solution is set to fire off at 1500ms: https://www.codewars.com/kata/reviews/58d1547353e019d4250003da/groups/5b368c2d15535073480011f3)
The Description needs an update; Voile's kata had been unpublished.
What's this?
11027 is invalid?
Hmm... I know that the javascript test fixtures have a ~300ms overhead, so ideally the total time there should be around 11300 ms. So from these results it looks like your Promises took a maximum of around 10700 ms to resolve, but my reasoning could be wrong. Make sure that each Promise returned from
antiOptimizeAsync
resolves 11000 ms after the respective call to the function itself. I'll try to update the tests to output how long each specific Promise takes to resolve when I get the chance.