-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CASSANDRA-20286: Accord: TableParamsTest is flakey due to bad generators and production validation logic missed the argument to String.format causing confusing errors #3865
base: cep-15-accord
Are you sure you want to change the base?
Conversation
…ors and production validation logic missed the argument to String.format causing confusing errors
@@ -146,7 +146,7 @@ static WeightedDc fromString(String s, int idx) | |||
else if (parts.length == 2) | |||
return new WeightedDc(validateDC(parts[0]), validateWeight(parts[1]), false); | |||
else | |||
throw cfe("Invalid dc weighting syntax %s, use <dc>:<weight>"); | |||
throw cfe("Invalid dc weighting syntax %s, use <dc>:<weight>", s); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was the error we saw in UI, and its because foo:bar:42
... the dc
had :
in the name, so hit this logic, but since , s
was missing it threw an issue with string formatting rather than the CFE we expected
@@ -36,17 +36,17 @@ public class TableParamsTest | |||
public void serdeLatest() | |||
{ | |||
DataOutputBuffer output = new DataOutputBuffer(); | |||
qt().forAll(tableParams()).checkAssert(FailingConsumer.orFail(params -> { | |||
qt().forAll(tableParams()).check(params -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
accord qt
will show the seed that failed when generators fail, but QuickTheories doesn't; making it hard to reproduce these type of errors.
I plan to migrate all tests off of QuickTheories after we merge to trunk, and these are cep-15-accord only tests....
@@ -47,16 +47,16 @@ public class ClusterMetadataSerializerTest | |||
public void serdeLatest() | |||
{ | |||
DataOutputBuffer output = new DataOutputBuffer(); | |||
qt().forAll(new ClusterMetadataBuilder().build()).checkAssert(orFail(cm -> { | |||
qt().forAll(Generators.toGen(new ClusterMetadataBuilder().build())).check(cm -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
accord qt
will show the seed that failed when generators fail, but QuickTheories doesn't; making it hard to reproduce these type of errors.
I plan to migrate all tests off of QuickTheories after we merge to trunk, and these are cep-15-accord only tests....
} | ||
|
||
@Test | ||
public void serdeWithoutAccord() | ||
{ | ||
DataOutputBuffer output = new DataOutputBuffer(); | ||
Gen<ClusterMetadata> gen = new ClusterMetadataBuilder().build().assuming(cm -> { | ||
Gen<ClusterMetadata> gen = Generators.toGen(new ClusterMetadataBuilder().build()).filter(cm -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
accord filter
doesn't have a bounded amount of retries but accuming
with QuickTheories does, making this test flakey. The issue is when a CM is generated without anything accord related... we filter those out... if you get unlucky and do this many times in a row assuming
would reject the build; filter
does not
.map(s -> s.replace(":", "_")) | ||
// Names are used for DCs and those are seperated by , | ||
.map(s -> s.replace(",", "_")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are the real bug fixes.
:
caused dc:weight
parser to fail (we expect 2, but had 3)
,
caused issues as we had a dc a,b
These are generator bugs and not allowed from CQL layer... so switched to _
to avoid shrinking the size
No description provided.