> On May 1, 2014, 12:24 p.m., Bill Havanki wrote: > > Hi there! > > > > (I'm new to ZK, and I'm checking out some code reviews to get acquainted > > with the project.) > > > > The unit test here is good, but it doesn't appear to check that the code > > selects the correct set of files to purge, but that the process at least > > completes. It would be good to break out the logic for selecting the files > > into a separate method and then testing that with mock data for the variety > > of snapshot and log files available. It'd be easy to test edge cases that > > way, too. I see that Mockito is already a ZK dependency, and that can > > definitely do it. I'd be happy to help out with creating such a test. > > Rakesh R wrote: > Thank you Bill, its really good idea to test as smaller units. I've tried > an approach without using mockito. Could you look at it ? > > Note: For testing purpose, I've created new method visible for testing > PurgeTxnLog#retainNRecentSnapshots()
Hi Rakesh, The new tests look great! They definitely do the job of verifying that the right files are purged. - Bill ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/19794/#review41921 ----------------------------------------------------------- On May 2, 2014, 11:07 a.m., Rakesh R wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/19794/ > ----------------------------------------------------------- > > (Updated May 2, 2014, 11:07 a.m.) > > > Review request for zookeeper, fpj, michim, Raul Gutierrez Segales, and > Camille Fournier. > > > Bugs: ZOOKEEPER-1797 > https://issues.apache.org/jira/browse/ZOOKEEPER-1797 > > > Repository: zookeeper > > > Description > ------- > > PurgeTxnLog may delete data logs if logs are rolling or a new snapshot is > created during this process > > > Diffs > ----- > > ./src/java/main/org/apache/zookeeper/server/PurgeTxnLog.java 1591929 > ./src/java/test/org/apache/zookeeper/server/PurgeTxnTest.java PRE-CREATION > ./src/java/test/org/apache/zookeeper/test/PurgeTxnTest.java 1591929 > > Diff: https://reviews.apache.org/r/19794/diff/ > > > Testing > ------- > > I've tried to add a tests > > > Thanks, > > Rakesh R > >