CASSANDRA-20286: Accord: TableParamsTest is flakey due to bad generators and production validation logic missed the argument to String.format causing confusing errors#3865
Conversation
…ors and production validation logic missed the argument to String.format causing confusing errors
| 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.
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
| { | ||
| DataOutputBuffer output = new DataOutputBuffer(); | ||
| qt().forAll(tableParams()).checkAssert(FailingConsumer.orFail(params -> { | ||
| qt().forAll(tableParams()).check(params -> { |
There was a problem hiding this comment.
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....
| { | ||
| 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.
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....
| { | ||
| 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.
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.
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
|
merged 3089226 |
No description provided.