Skip to content
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

[Improvement] Remove redundant Thread.sleep wherever possible #3214

Closed
yuqi1129 opened this issue Apr 29, 2024 · 0 comments · Fixed by #3239
Closed

[Improvement] Remove redundant Thread.sleep wherever possible #3214

yuqi1129 opened this issue Apr 29, 2024 · 0 comments · Fixed by #3239
Labels
0.6.0 Release v0.6.0 good first issue Good for newcomers improvement Improvements on everything

Comments

@yuqi1129
Copy link
Contributor

What would you like to be improved?

We used the following code pattern to wait for the resource that haven't be ready

while( xxxx) {
  xxxxx
  Thread.sleep(xxx);
}

I think we can remove these code patterns as many as possible and use awaitility instead. for please please refer to

    Awaitility.await()
        .atMost(MAX_WAIT_IN_SECONDS, TimeUnit.SECONDS)
        .pollInterval(WAIT_INTERVAL_IN_SECONDS, TimeUnit.SECONDS)
        .untilAsserted(
            () ->
                ITUtils.assertColumn(
                    Column.of(DORIS_COL_NAME3, Types.VarCharType.of(255), "col_3_comment"),
                    tableCatalog.loadTable(tableIdentifier).columns()[2]));

How should we improve?

No response

@yuqi1129 yuqi1129 added improvement Improvements on everything good first issue Good for newcomers labels Apr 29, 2024
@yuqi1129 yuqi1129 added 0.6.0 Release v0.6.0 and removed 0.6.0 Release v0.6.0 labels May 6, 2024
yuqi1129 pushed a commit that referenced this issue May 6, 2024
…eep` (#3239)

### What changes were proposed in this pull request?

use `Awaitility#await` instead of `Thread#sleep`

### Why are the changes needed?

Fix: #3214 

### Does this PR introduce _any_ user-facing change?

N/A 

### How was this patch tested?

ITs

---------

Co-authored-by: zhanghan18 <zhanghan18@xiaomi.com>
@yuqi1129 yuqi1129 added the 0.6.0 Release v0.6.0 label May 6, 2024
yuqi1129 pushed a commit to yuqi1129/gravitino that referenced this issue May 23, 2024
…ead#sleep` (apache#3239)

### What changes were proposed in this pull request?

use `Awaitility#await` instead of `Thread#sleep`

### Why are the changes needed?

Fix: apache#3214 

### Does this PR introduce _any_ user-facing change?

N/A 

### How was this patch tested?

ITs

---------

Co-authored-by: zhanghan18 <zhanghan18@xiaomi.com>
yuqi1129 pushed a commit to yuqi1129/gravitino that referenced this issue May 23, 2024
…ead#sleep` (apache#3239)

### What changes were proposed in this pull request?

use `Awaitility#await` instead of `Thread#sleep`

### Why are the changes needed?

Fix: apache#3214 

### Does this PR introduce _any_ user-facing change?

N/A 

### How was this patch tested?

ITs

---------

Co-authored-by: zhanghan18 <zhanghan18@xiaomi.com>
yuqi1129 added a commit that referenced this issue May 23, 2024
…eep` (#3529)

### What changes were proposed in this pull request?

use `Awaitility#await` instead of `Thread#sleep`

### Why are the changes needed?

Fix: #3214 

### Does this PR introduce _any_ user-facing change?

N/A 

### How was this patch tested?

ITs

Co-authored-by: XiaoZ <57973980+xiaozcy@users.noreply.github.com>
Co-authored-by: zhanghan18 <zhanghan18@xiaomi.com>
diqiu50 pushed a commit to diqiu50/gravitino that referenced this issue Jun 13, 2024
…ead#sleep` (apache#3239)

### What changes were proposed in this pull request?

use `Awaitility#await` instead of `Thread#sleep`

### Why are the changes needed?

Fix: apache#3214 

### Does this PR introduce _any_ user-facing change?

N/A 

### How was this patch tested?

ITs

---------

Co-authored-by: zhanghan18 <zhanghan18@xiaomi.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.6.0 Release v0.6.0 good first issue Good for newcomers improvement Improvements on everything
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant