Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Debounce like a boss #18

Merged
merged 9 commits into from Dec 29, 2012

Conversation

Projects
None yet
2 participants
Contributor

atuttle commented Dec 13, 2012

Debounce, Debounce Tests (both immediate true and false), and updated the doc generator for debounce. Also added some linebreaks in generated docs.

Owner

russplaysguitar commented Dec 14, 2012

I can't wait to test this out! I wish travis-ci worked with CF so I didn't have to manually re-test!

The other Underscore methods that return functions list the return type as "any". I think that return type "function" is probably better (even if it is technically "any" in CF). We'll need to update the other method meta-docs though to be consistent.

Contributor

atuttle commented Dec 14, 2012

I've got Jenkins running for Taffy. I'd be happy to host the tests for Underscore too. Maybe I'll do that as one of my pull requests. ;)

Owner

russplaysguitar commented Dec 14, 2012

A jenkins server would be great!

Owner

russplaysguitar commented Dec 14, 2012

Thanks for the css fix.

I'm getting intermittent test failures for debounce in CF. I'm running Win7 64 with CF 10 update 6. Only 1gb RAM (it's in a VM).

The failures appear when using runTests.cfm. If you can't reproduce the issues then I'll try to investigate further and provide more feedback.

Contributor

atuttle commented Dec 14, 2012

There are some assertions have have to do with time elapsed, which could be different on different hardware. I'll take a look at them tonight. Can you provide any detail on the failures?

Contributor

atuttle commented Dec 14, 2012

Oh and I haven't installed update 6 yet locally. Will try that too and see if it changes anything.

Contributor

atuttle commented Dec 15, 2012

Installed update 6 and re-ran the tests a bunch of times. Average run time for testDebounce_ImmediateTrue is about 107ms for me. One time I saw it go up to 127ms, and the actual result went up to 4 instead of 3. If there were something unrelated that caused a 20ms delay in there, the debounce test assertions would be wrong because it's possible that enough time would have passed from the external delay to allow the function to run. The tests are kind of written assuming they're running in a vacuum. Without adding significant sleep durations that would slow down the test suite I don't see a way around it. But it only failed for me once out of more than 30 runs.

Owner

russplaysguitar commented Dec 15, 2012

Intermittent failures:

testDebounce_ImmediateTrue: once on the leading edge
Expected [2] BUT RECEIVED [3.0]. These values should be the same.

testDebounce_ImmediateFalse: debounce calms overzealous method calling
Expected [2] BUT RECEIVED [1.0]. These values should be the same.

testDelay: function delay is at least as long as requested

Contributor

atuttle commented Dec 27, 2012

How about now? With the latest changes I'm not getting any failures at all with dozens and dozens of runs.

Owner

russplaysguitar commented Dec 29, 2012

Awesome, I just confirmed that this works in CF10.

It doesn't work in Railo 4, but I have a fix for that already which I'll apply after this is merged.

Thanks a ton for implementing this!

russplaysguitar added a commit that referenced this pull request Dec 29, 2012

@russplaysguitar russplaysguitar merged commit 48e84a1 into russplaysguitar:master Dec 29, 2012

Contributor

atuttle commented Dec 29, 2012

Your changes look good. I'd have used isDefined too. I'm curious about the Railo bug tho. Have you reported it?

Owner

russplaysguitar commented Dec 29, 2012

I haven't reported it yet. Honestly, their issue tracker scares me.

Owner

russplaysguitar commented Dec 30, 2012

Nice, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment