[ https://issues.apache.org/jira/browse/CASSANDRA-14821?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16665073#comment-16665073 ]
Robert Stupp commented on CASSANDRA-14821: ------------------------------------------ Many people have tried such class-loader approaches in the past and all attempts to do so have failed (making things worse, cluttered the code base, or simply failed to work) sooner or later - especially in an environment where static-initializers are used all over the place. Deprecating dtests is just wrong as long as there is no replacement that can test things in the same way as dtests do. How do you test startup scripts? How do you invoke all the tools? What happens if you kill an instance? How to you intend to test upgrades? Or is there some other tool that can do test things like that, that's not mentioned here? Testing distributed processes in a single JVM is definitely not the same as testing it in multiple JVMs. The patch itself touches a lot of quite important areas in the code base and adds a bunch of test-only code to the production code base. What's the performance impact of a change like this? How does this change work in Java 11 or even with upcoming features? What's the plan to maintain that? Please feel free to prove me wrong by implementing this in a fork and running it in parallel over multiple months and the tests implemented with this approach can do the same things as dtests do and also show the same test results as dtests do. I agree, that testing the code base is hard and dtests are not the most convenient thing, but I'm really afraid that this one introduces more difficulties and other issues than it solves. > Make it possible to run multi-node coordinator/replica tests in a single JVM > ---------------------------------------------------------------------------- > > Key: CASSANDRA-14821 > URL: https://issues.apache.org/jira/browse/CASSANDRA-14821 > Project: Cassandra > Issue Type: Test > Reporter: Alex Petrov > Assignee: Alex Petrov > Priority: Major > > This patch proposes an in-JVM Distributed Tester that can help to write > distributed tests in a single JVM and be able to control node behaviour in a > fine-grained way and set up nodes exactly how one needs it: configuration > settings, parameters, which are also controllable in runtime on a per node > basis, so each node can have its own unique state. > It fires up multiple Cassandra Instances in a single JVM. It is done through > having distinct class loaders in order to work around the singleton problem > in Cassandra. In order to be able to pass some information between the nodes, > a common class loader is used that loads up java standard library and several > helper classes. Tests look a lot like CQLTester tests would usually look like. > Each Cassandra Instance, with its distinct class loader is using > serialisation and class loading mechanisms in order to run instance-local > queries and execute node state manipulation code, hooks, callbacks etc. > First version mocks out Messaging Service and simplifies schema management by > simply running schema change commands on each of the instances separately. > Internode communication is mocked by passing ByteBuffers through shared class > loader. > |[patch|https://github.com/ifesdjeen/cassandra/tree/in-jvm-distributed-tests-2]|[tests|https://circleci.com/workflow-run/d88a1278-596c-4af1-9a03-998e9f6c78d3]| -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org