Ad
  • Custom User Avatar

    Random test sometimes generates race condition like this:

    2 breaks | 30ms initial idle timeout | t=10ms, t=140ms, t=270ms
    expected 3 to equal 2
    

    At t=270ms the function is called while it's time for a break. What is the expected behaviour here? If there's a specific desired behaviour then it should be tested in sample test; if not then it shouldn't be generated at all.

  • Custom User Avatar

    Given the backstory, I think it's quite defensible to start aiming for a break as soon as you clock in. ( Dog knows I do! )

    It may not be what you want for the task, but the task is defined in light of the backstory!

  • Custom User Avatar

    Yes I think so

  • Custom User Avatar

    It's not allowed to do a break before the returned function is called.

    Better?

  • Custom User Avatar

    Yes I did that one first when I misunderstood the task slightly, the name of the function startWorking to me implied that we should already start the timer.

    I think the

    It's not possible that you don't have any work to do

    might be more confusing than it is helpful. Something more direct like "The timer should not start until the returned function is called" might be better. (There are probably even better ways to say that)

  • Custom User Avatar

    There is always work to do (it's called at least once).
    I like to avoid that you do a break without working.

  • Custom User Avatar

    Shouldn't that be "It is possible .." ?

  • Custom User Avatar

    Thx Kacarott,
    I checked your results and updated the tests and description to avoid this solution:
    https://www.codewars.com/kata/reviews/60a24cfbf2b4d60001148fe2/groups/60a3518d3238e20001424f96

    This should not be possible, but I understand why you did this 👍.

    Added:

    It's not possible that you don't have any work to do.

    generateTest(50, [200]);

  • Custom User Avatar

    I've done my part. While pretty easy, it is also very unique and I think many JS beginners will appreciate it.

  • Custom User Avatar

    :), I'm happy with the result of my first kata.
    Now I know what to expect next time.
    I hope it won't be similar to Implement Debounce which is open for 4 years.

  • Custom User Avatar

    That's just not how it works. Sorry. Incentive to get everything completely right first time! ( I know, sometimes that's just impossible. )

  • Custom User Avatar

    I added this part:

    Running tests require 6-10 seconds to complete, depending on the timeouts of the random tests.

    Alright, I hope they will update their votes soon. Wouldn't it make sense to reset the rating after big changes?

  • Custom User Avatar

    Here's hoping raters will come back and update their vote .. or it might be quite a while before the legacy "meh" votes get outnumbered by newer, more positive ones.

  • Custom User Avatar

    Looks nice. Lots of things I don't really understand happening - I'm not big on async stuff.

    Testing takes quite a while. You might want to warn solvers about that. If you can do testing in, say, 4 seconds, instead of 10, that'd be nice ( but I understand this stuff will always take time ).

  • Custom User Avatar

    Tests are refactored and random tests are added.
    Wdyt?
    Thx for your feedback, it's very helpful.

  • Loading more items...