[ https://issues.apache.org/jira/browse/CASSANDRA-19731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17866698#comment-17866698 ]
Stefan Miklosovic edited comment on CASSANDRA-19731 at 7/17/24 10:59 AM: ------------------------------------------------------------------------- [~drohrer] we could probably just skip this in upgrades if that is your concern? I dont know the details but I guess we can detect if it runs in the scope of a dtest or not and then add it or not among the shared ones? Would that fix it? I think that is what you last comment is about. was (Author: smiklosovic): [~drohrer] we could probably just skip this in upgrades if that is your concern? I dont know the details but I guess we can detect if it runs in the scope of a dtest or not and then add it or not among the shared ones? Would that fix it? > Consider adding exceptions among shared packages in in-jvm dtest api > -------------------------------------------------------------------- > > Key: CASSANDRA-19731 > URL: https://issues.apache.org/jira/browse/CASSANDRA-19731 > Project: Cassandra > Issue Type: Improvement > Components: Test/dtest/java > Reporter: Stefan Miklosovic > Assignee: Stefan Miklosovic > Priority: Normal > > This does not work > {code} > try (Cluster ignored = build(1) > .withConfig(c -> c.with(Feature.NETWORK, > Feature.NATIVE_PROTOCOL, Feature.GOSSIP) > > .set("some_property_which_throws_when_misconfigured", value)) > .start()) > { > fail("should throw ConfigurationException"); > } > catch (Exception ex) > { > assertEquals(ConfigurationException.class, ex.getClass()); > } > {code} > Because ConfigurationException is not shared so it looks like it doesn't > match. > this is workaround > {code} > Predicate<String> EXTRA = className -> > className.equals(ConfigurationException.class.getName()); > Cluster.Builder builder = build(1); > assertThatThrownBy(() -> builder > > .withSharedClasses(EXTRA.or(builder.getSharedClasses())) > .start()) > .isInstanceOf(ConfigurationException.class); > {code} > But to have it nice and clean like this, it would require us to share all > exceptions, to add them to "DEFAULT_SHARED_PACKAGES". in > "org.apache.cassandra.distributed.shared.InstanceClassLoader". > {code} > assertThatThrownBy(() -> build(1).withConfig(c -> > c.set("some_property_which_throws_when_misconfigured", value)).start()) > .isInstanceOf(ConfigurationException.class); > {code} > We could just put all package there. > This would require release of in-jvm dtest api. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org