-
Notifications
You must be signed in to change notification settings - Fork 103
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
Yaml test option to force continuations #3075
Conversation
…from "set to 0", so we can skip the forceContinuations option if maxRows explicitly set to 0
Result of fdb-record-layer-pr on Linux CentOS 7
|
…nConfig is required for assertions
Result of fdb-record-layer-pr on Linux CentOS 7
|
Result of fdb-record-layer-pr on Linux CentOS 7
|
import java.util.Optional; | ||
import java.util.function.Supplier; | ||
|
||
@SuppressWarnings({"PMD.GuardLogStatement"}) // It already is, but PMD is confused and reporting error in unrelated locations. | ||
public final class YamlExecutionContext { | ||
public static final String OPTION_FORCE_CONTINUATIONS = "optionForceContinuations"; |
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.
Would it make sense to allow the compiler to do more protecting here, and have an object with setters, e.g.
new Options().setForceContinuations(true)
Or do you see some reason that this may have to pass options along that it is unaware of?
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.
There is a pattern that we can use to enforce types by creating a generic-typed enum constants. Let me see if it creates a better experience.
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.
I'll get that done in a followup in an attempt to get this PR in sooner to get coverage increase
yaml-tests/src/main/java/com/apple/foundationdb/relational/yamltests/command/QueryExecutor.java
Outdated
Show resolved
Hide resolved
yaml-tests/src/main/java/com/apple/foundationdb/relational/yamltests/command/QueryExecutor.java
Outdated
Show resolved
Hide resolved
yaml-tests/src/main/java/com/apple/foundationdb/relational/yamltests/command/QueryExecutor.java
Outdated
Show resolved
Hide resolved
yaml-tests/src/main/java/com/apple/foundationdb/relational/yamltests/command/QueryExecutor.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
@Override | ||
@Disabled("Infinite continuation loop") |
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.
Instead of just comments, should these reference issues?
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.
Done.
This PR adds the ability to force
maxRows:1
onto YAML tests that do not otherwise specify the maxRows. The forced maxRows is set to 1, which means that every test that has more than 0 rows back will result in a continuation being issued and another request being made. The tests will be run in a separate and independent run, not impacting any of the existing coverage. The existing assertions will be used without modification to verify the results of the modified tests: The result set returned to the Matcher is an aggregate result set that contains all the "one liner" result sets returned from the query requests.Another new feature is the ability to distinguish between
marrows:0
and not havingmaxRows
specified. The former will prevent the forcing of continuations while maintaining the "no limit" semantics. The latter will use the default "no limit" normally but will allow the forcing of continuations when running in that mode.