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

Doug Rohrer commented on CASSANDRA-19731:
-----------------------------------------

Yeah, essentially we want to have a set of shared packages for single-version 
tests and one for upgrade tests, where the upgrade tests don't share certain 
classes as they may break between versions. If it's possible to +detect+ that 
you're running an +upgrade dtest+ or not I'm not sure, but if there's some 
reasonable way to do that then your suggestion makes perfect sense. Otherwise, 
we should have 2 methods, one that produces the predicate that does not include 
potentially version-specific packages like exceptions, and another that 
includes them for single-version tests.

> 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

Reply via email to