You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Chris Nauroth (JIRA)" <ji...@apache.org> on 2015/04/26 01:52:38 UTC
[jira] [Updated] (ZOOKEEPER-2062) RemoveWatchesTest takes forever
to run
[ https://issues.apache.org/jira/browse/ZOOKEEPER-2062?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chris Nauroth updated ZOOKEEPER-2062:
-------------------------------------
Attachment: ZOOKEEPER-2062.001.patch
[~rakeshr], I'm attaching a patch that speeds up the 4 slowest tests in the suite. Would you be interested in reviewing? Running the entire {{RemoveWatchesTest}} suite from trunk on my machine takes ~5 minutes. With this patch, that drops to ~2 minutes.
This required hooking into the internals of some of the production code. This is the least intrusive way to do it that I could find, but let me know if you have other ideas. I've defined a new {{WatchManagerListener}} interface that receives direct notification when the {{WatchManager}} triggers a watch. For the tests that need to check that they did not receive notification after removing a watch, they can use the listener to check immediately instead of relying on a long wait to be sure. This also makes the tests deterministic as opposed to the waiting approach.
I wanted to make sure I didn't harm what the tests were trying to prove. To do that, I temporarily introduced a bug in my local environment. I hacked {{ZKDatabase#removeWatch}} so that it didn't actually remove the watch. When I did that, the tests still failed and caught the bug (as they should).
Please let me know your thoughts on the patch. It would be nice to shave a few minutes off of every pre-commit run. :-)
> RemoveWatchesTest takes forever to run
> --------------------------------------
>
> Key: ZOOKEEPER-2062
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2062
> Project: ZooKeeper
> Issue Type: Bug
> Components: tests
> Reporter: Flavio Junqueira
> Attachments: ZOOKEEPER-2062.001.patch
>
>
> [junit] Running org.apache.zookeeper.RemoveWatchesTest
> [junit] Tests run: 46, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 306.188 sec
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)