I deploy/distribute the Cassandra database as an embedded service allowing me to create a basic cassandra.yaml file based on the global cluster of machines (seeds, non-seeds, ports, disks, etc...). That allows me to configure and upgrade my own software and the cassandra software using the same cassandra.yaml. That yaml file has no tokens specified in it, still having a vnode cluster (thanks cassandra) .
In previous versions that was ok, since the cassandra code was simply accepting the tokens it saved in its own database, disregarding any changes one made in the yaml file ( there was no test like bootstrapTokens.size() != DatabaseDescriptor.getNumTokens() ). I guess there was some logic to that, since at that time the system is not bootstrapping and thus should/could use the known token configuration without using the yaml token parameter. Also, isn't this small code change of CASSANDRA-7649 inspired on balancing problems going to vnodes (CASSANDRA-7601) using a random partitioner. And in my case I'm using a ByteOrdered partitioner, forcing me to balance/move/add nodes/tokens myself. And as the description is saying, it was meant to avoid 'to change the number of tokens', that test is doing a little more (from my point of view). Well, in short : I would be in favor of removing that test, clearly leaving a message that the "saved tokens" are used, not the yaml configured tokens. Regards, Ignace