dcapwell commented on PR #3486:
URL: https://github.com/apache/cassandra/pull/3486#issuecomment-2313360928

   ok pushed to using the new `CommandsBuilder`... the test is now
   
   ```
   statefulBuilder.check(commands(this::stateGen)
                                 .preCommands(state -> 
state.preActions.forEach(Runnable::run))
                                 .add(2, (rs, state) -> {
                                     EnumSet<TopologyChange> 
possibleTopologyChanges = possibleTopologyChanges(state);
                                     if (possibleTopologyChanges.isEmpty()) 
return ignoreCommand();
                                     return topologyCommand(state, 
possibleTopologyChanges).next(rs);
                                 })
                                 .add(1, (rs, state) -> repairCommand(state, 
rs.pickInt(state.topologyHistory.up())))
                                 .add(7, (rs, state) -> 
state.statementGen.apply(rs, state))
                                 .destroyState((state, cause) -> {
                                     
TopologyMixupTestBase.this.destroyState(state, cause);
                                     state.close();
                                 })
                                 .build());
   ```
   
   still not a fan of `preCommands` but also not a fan of what I am doing 
now... at least this interface doesn't make things worse...
   
   one thing that is nice with this builder is I flip `Gen<Command>, Weight`, I 
personally prefer weight first then the command, always found the gen first 
harder to read (its an impl detail, we store the Gen in the map as the key)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to