-
Notifications
You must be signed in to change notification settings - Fork 33
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
Implement and test transaction timeouts #364
Implement and test transaction timeouts #364
Conversation
@@ -126,6 +126,7 @@ vaticle_typedb_artifact() | |||
vaticle_typedb_cluster_artifact() | |||
|
|||
# Load maven | |||
load("@vaticle_typedb_common//dependencies/maven:artifacts.bzl", vaticle_typedb_common_artifacts = "artifacts") |
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.
we need to load common
maven requirements as well
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.
why?
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.
because we depend on all of common, and common now has a sub-library (without its own package) that requires maven dependencies!
public static TypeDBOptions sessionOptions; | ||
public static TypeDBOptions transactionOptions; | ||
static boolean isBeforeAllRan = false; | ||
|
||
public static final Map<String, BiConsumer<TypeDBOptions, Integer>> optionSetters = map( | ||
pair("session-idle-timeout-millis", TypeDBOptions::sessionIdleTimeoutMillis), | ||
pair("transaction-timeout-millis", TypeDBOptions::transactionTimeoutMillis) | ||
); |
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.
we set up only the initial options we need to configure
@@ -126,6 +126,7 @@ vaticle_typedb_artifact() | |||
vaticle_typedb_cluster_artifact() | |||
|
|||
# Load maven | |||
load("@vaticle_typedb_common//dependencies/maven:artifacts.bzl", vaticle_typedb_common_artifacts = "artifacts") |
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.
why?
@@ -45,6 +47,7 @@ void beforeAll() { | |||
} | |||
server.start(); | |||
TypeDBSingleton.setTypeDBRunner(server); | |||
ConnectionStepsBase.isBeforeAllRan = true; |
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 isn't necessary, right? Since the implementation of before
in ConnectionStepsBase
already sets isBeforeAllRan
to true
,
(having said that, isBeforeAllRan
being set in a method that isn't beforeAll
feels pretty dodgy, so perhaps there is a better solution here)
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.
cleaned it up
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.
Urgh actually im going to revert this, and when we upgrade Cucumber we can use a new version that has @BeforeAll
and @AfterAll
@@ -114,4 +131,8 @@ void connection_does_not_have_any_database() { | |||
assertNotNull(client); | |||
assertTrue(client.isOpen()); | |||
} | |||
|
|||
void wait_seconds(int seconds) throws InterruptedException { |
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.
Feels like this should be in some kind of UtilSteps
.. but then it'd be all alone, so ¯\_(ツ)_/¯
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.
Actually let me do that, it'll probably grow
@@ -152,4 +155,12 @@ public void sessions_in_parallel_have_databases(List<String> names) { | |||
|
|||
CompletableFuture.allOf(assertions).join(); | |||
} | |||
|
|||
@Given("set session option {word} to: {int}") | |||
public void set_session_option_to(String option, int value) { |
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.
We have options that are not int
-valued. Even though we aren't testing them yet, I imagine we'll do so soon, so we should future-proof this step by renaming it to
@Given("set session option {word} to int: {int}")
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.
Implemented this by always using strings and parsing them in the option setters
e3ff97c
to
c7aa564
Compare
## What is the goal of this PR? Add transaction timeouts to the console options available. This allows users to manipulate the transaction timeout added in typedb/typedb-driver#364. ## What are the changes implemented in this PR? * add extra option for transaction timeout * bump version to 2.6.1 to prepare for patch release
## What is the goal of this PR? We revert previous changes from #368 and #364, which made query queues and iterators throw the same error idempotently if there was one. However, this goes counter to standard usages of iterators and queues, which are not meant to behave idempotently (each item is only returned once, and if they have an error they should no longer be used). ## What are the changes implemented in this PR? * remove idempotent error state of collectors and queues, which back query iterators
What is the goal of this PR?
We implement options for transaction timeout configuration (typedb/typedb#6487). We also add BDD implementation for new steps required to test transaction timeout and configuring transaction options.
What are the changes implemented in this PR?