slfan1989 commented on code in PR #564:
URL: https://github.com/apache/fluss-rust/pull/564#discussion_r3307799665
##########
crates/fluss/tests/integration/utils.rs:
##########
@@ -100,6 +101,94 @@ pub async fn create_table(
.expect("Failed to create table");
}
+const READINESS_TIMEOUT: Duration = Duration::from_secs(30);
+const READINESS_POLL_INTERVAL: Duration = Duration::from_millis(200);
+
+/// Waits until the default bucket of a non-partitioned table can serve offset
requests.
+///
+/// Newly-created tables may not have bucket leaders immediately. Polling list
offsets avoids
+/// fixed sleeps that are either flaky on slow CI or waste time when the
cluster is ready sooner.
+pub async fn wait_for_table_ready(admin: &FlussAdmin, table_path: &TablePath) {
+ wait_for_table_buckets_ready(admin, table_path, &[0]).await;
Review Comment:
Thanks for clarifying this! Exactly — `wait_for_table_ready` is a
convenience wrapper for the default single-bucket case, while
`wait_for_table_buckets_ready` is needed by `until_offsets_multi_bucket` to
ensure that all buckets are ready before the test proceeds. I'll keep both
helpers for these two scenarios.
##########
crates/fluss/tests/integration/utils.rs:
##########
@@ -100,6 +101,94 @@ pub async fn create_table(
.expect("Failed to create table");
}
+const READINESS_TIMEOUT: Duration = Duration::from_secs(30);
+const READINESS_POLL_INTERVAL: Duration = Duration::from_millis(200);
+
+/// Waits until the default bucket of a non-partitioned table can serve offset
requests.
+///
+/// Newly-created tables may not have bucket leaders immediately. Polling list
offsets avoids
+/// fixed sleeps that are either flaky on slow CI or waste time when the
cluster is ready sooner.
+pub async fn wait_for_table_ready(admin: &FlussAdmin, table_path: &TablePath) {
+ wait_for_table_buckets_ready(admin, table_path, &[0]).await;
Review Comment:
@fresh-borzoni Thanks for clarifying this! Exactly — `wait_for_table_ready`
is a convenience wrapper for the default single-bucket case, while
`wait_for_table_buckets_ready` is needed by `until_offsets_multi_bucket` to
ensure that all buckets are ready before the test proceeds. I'll keep both
helpers for these two scenarios.
--
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]