dcapwell commented on code in PR #4220:
URL: https://github.com/apache/cassandra/pull/4220#discussion_r2226861711
##########
test/simulator/main/org/apache/cassandra/simulator/ActionSchedule.java:
##########
@@ -73,7 +73,65 @@ public class ActionSchedule implements
CloseableIterator<Object>, LongConsumer
{
private static final Logger logger =
LoggerFactory.getLogger(ActionList.class);
- public enum Mode { TIME_LIMITED, STREAM_LIMITED, TIME_AND_STREAM_LIMITED,
FINITE, UNLIMITED }
+ public enum Mode
+ {
+ /**
+ * Definition: Runs the simulation for a specific duration (specified
by {@link Work#runForNanos})
+ * Behavior: After the time limit is reached, cancels both daemon
tasks and stream actions
+ * Use cases:
+ * <ul>
+ * <li>Testing system behavior for a specific duration</li>
+ * <li>Ensuring tests complete within time boundaries</li>
+ * <li>Simulating time-constrained scenarios</li>
+ * </ul>
+ */
+ TIME_LIMITED,
+ /**
+ * Definition: Runs until all finite streams are processed ({@link
#activeFiniteStreamCount} reaches 0)
+ * Behavior: Once all finite streams complete, cancels daemon tasks
+ * Use cases:
+ * <ul>
+ * <li>Ensuring all finite operations complete</li>
+ * <li>Testing scenarios where operation completion is more
important than time</li>
+ * <li>Validating behavior after all finite operations finish</li>
+ * </ul>
+ */
+ STREAM_LIMITED,
+ /**
+ * Definition: Combines both time and stream limitations
+ * Behavior: Cancels daemon tasks if either all finite streams
complete OR the time limit is reached
+ * Use cases:
+ * <ul>
+ * <li>Tests that should terminate on whichever condition happens
first</li>
+ * <li>Flexible scenarios requiring either completion or
timeout</li>
+ * <li>Testing resilience against both completion and time
constraints</li>
+ * </ul>
+ */
+ TIME_AND_STREAM_LIMITED,
+ /**
+ * Definition: Does not allow stream actions at all
+ * Behavior: Throws IllegalStateException if stream actions are added;
no special handling for daemon tasks
+ * Use cases:
+ * <ul>
+ * <li>Testing deterministic scenarios with a fixed set of
actions</li>
+ * <li>Avoiding recurring or streaming operations</li>
+ * <li>Unit tests with controlled inputs</li>
+ * </ul>
+ */
+ FINITE,
+ /**
+ * Definition: Focused on daemon task management without time/stream
constraints
Review Comment:
tried to reword this
--
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]