When the test case is executed for the first time after Cassandra is started, it passes, but shows that after the INSERT which was supposed to insert 10,000 rows the table contains 10,001 rows. When the very same test case is run for the second time without restarting Cassandra, SELECT COUNT causes an exception (not fatal) in Cassandra and a crash in server.
The second SELECT (with GROUP BY) is not necessary for the test case, it just shows that the extra record is for real.
First run result:
Cassandra exception after the second run:
Server stack trace: