Conversation
…misc/test_improvements
The force_quorum method check for other instances connectivity, so it will fail. Keep then frozen
| # TODO: modify/expose timeout in the mysql-shell-client library | ||
| address = f"{instance_def}:3306" | ||
| command = "\n".join(( | ||
| f"cluster = dba.get_cluster('{self.cluster_name}')", | ||
| f"cluster.force_quorum_using_partition_of('{address}')", | ||
| )) | ||
|
|
||
| executor = self._build_cluster_tcp_executor(self.instance_address) |
There was a problem hiding this comment.
@sinclert-canonical , testing this here, but how should we expose timeout at this level?
There was a problem hiding this comment.
At the moment, timeouts can only be applied in an operation-per-operation basis, in the BaseExecutor subclasses (see code). That means that timeouts can only be applied when manually executing the Python / SQL operations via an executor class.
I originally thought about exposing this argument one level up the chain, in the client classes, but it feels noisy to do in an operation-per-operation basis (i.e. every class method will have an additional arg), and a bit overkill in their constructors, as not every operation should have the same timeout.
Open to ideas.
| def wait_model_1(): | ||
| model_1.wait( | ||
| ready=wait_for_apps_status(jubilant_backports.all_active, MYSQL_APP_1), | ||
| timeout=10 * MINUTE_SECS, | ||
| ) | ||
|
|
||
| def wait_model_2(): | ||
| model_2.wait( | ||
| ready=wait_for_apps_status(jubilant_backports.all_active, MYSQL_APP_2), | ||
| timeout=10 * MINUTE_SECS, | ||
| ) | ||
|
|
||
| with ThreadPoolExecutor() as executor: | ||
| futures = [executor.submit(wait_model_1), executor.submit(wait_model_2)] | ||
| for future in futures: | ||
| future.result() |
There was a problem hiding this comment.
I'm curious, what does this accomplish? Practically speaking, the execution won't go past this point until both .wait calls return, which is what the sequential code does too.
| constraints=constraints, | ||
| ) | ||
|
|
||
| model_1.deploy( |
There was a problem hiding this comment.
Does this intersect with https://warthogs.atlassian.net/browse/DPE-9668 ?
No description provided.