[ 
https://issues.apache.org/jira/browse/CASSANDRA-6968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14012311#comment-14012311
 ] 

Lyuben Todorov commented on CASSANDRA-6968:
-------------------------------------------

Committed to 
[fc7e0d0c7|https://github.com/lyubent/cassandra/commit/fc7e0d0c71b692ffb15c01b6433dfffeed10737e]
 The patch is substancial, but there is a fair improvement in unit test 
runtime. On my machine runtime fell from 16 minutes 58 seconds to 10 minutes 29 
seconds, _approx 37% less_.

Changes so far: 
# No longer extending SchemaLoader unless insertData / readData are required
# Statically starting gossip & initialising Keyspace.
# Added a check to stop gossip only if not initialised (not all unit tests use 
gossip)
# Each test uses a unique set of keyspaces (basically the class name)
# Unit tests define their own schema (to be more self-contained, but this sadly 
adds lots of LoC)

Todo:
# Fix the Long tests that use {{SchemaLoader}}.

The biggest time savers are avoiding the use of {{SL#cleanupAndLeaveDirs}} and 
reducing the creationg of KSs. To keep things hopefully simpler I'll also add 
[this diff between two runs|http://www.diffchecker.com/ko1m5w53], on the left 
is C*  trunk c9240e7e8e7e92519f50cfb79b7530f29d9432a0 without the patch, on the 
right is C* trunk with the patch.

> Reduce Unit Test Times Due to Schema Loading
> --------------------------------------------
>
>                 Key: CASSANDRA-6968
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6968
>             Project: Cassandra
>          Issue Type: Test
>          Components: Tests
>            Reporter: Tyler Hobbs
>            Assignee: Lyuben Todorov
>            Priority: Minor
>             Fix For: 2.1.1
>
>
> Unit tests which extend SchemaLoader take about 6s longer to run than the 
> others, on average.  We could greatly reduce the time it takes to run the 
> tests by improving this.
> None of the tests require everything that SchemaLoader does.  We should 
> change SchemaLoader into a set of test utilities that are run as needed in 
> {{\@BeforeClass}} and {{\@AfterClass}} methods.  Additionally, instead of 
> running a full cleanup, most tests could simply use a keyspace or column 
> family with a unique name (class/method name or perhaps class/method name + 
> timestamp).



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to