Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

test: attempt to fix flaky test#1584

Merged
mutianf merged 11 commits into
googleapis:mainfrom
mutianf:flaky-test
Jan 23, 2023
Merged

test: attempt to fix flaky test#1584
mutianf merged 11 commits into
googleapis:mainfrom
mutianf:flaky-test

Conversation

@mutianf

@mutianf mutianf commented Jan 17, 2023

Copy link
Copy Markdown
Contributor

UnaryMetricsMetadataIT: testFailure sometimes fails with:

expected to contain: unspecified
but was            : []

Setting a longer wait time before checking opencensus stats. Also assign the returned value to a future.

DynamicFlowControlCallableTest sometimes fails with:

value of: getLastAdjustedTimestampMs()
expected: 0
but was : 1669306507692
	at com.google.cloud.bigtable.data.v2.stub.DynamicFlowControlCallableTest.testLatenciesAreRecorded(DynamicFlowControlCallableTest.java:105)

Cleanup DyanmicFlowControlStats after each test, and create a new Stats instance and callable inside the testLatenciesAreRecorded test.

@product-auto-label product-auto-label Bot added size: s Pull request size is small. api: bigtable Issues related to the googleapis/java-bigtable API. labels Jan 17, 2023
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Jan 17, 2023
@product-auto-label product-auto-label Bot added size: s Pull request size is small. and removed size: m Pull request size is medium. labels Jan 23, 2023
@mutianf mutianf marked this pull request as ready for review January 23, 2023 15:42
@mutianf mutianf requested a review from a team January 23, 2023 15:42
Comment on lines 72 to 77
// give opencensus some time to populate view data
Thread.sleep(100);
Thread.sleep(1000);

List<String> tagValueStrings = StatsWrapper.getOperationLatencyViewTagValueStrings();
assertThat(tagValueStrings).contains(clusters.get(0).getZone());
assertThat(tagValueStrings).contains(clusters.get(0).getId());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont love blindly extending sleeps. Can we switch this to polling instead?

for(int i=0; i<10;i++) {
if(StatsWrapper.getOperationLatencyViewTagValueStrings()).contains(clusters.get(0).getId()) {
break;
}

List<String> tagValueStrings = StatsWrapper.getOperationLatencyViewTagValueStrings();
assertThat(tagValueStrings).contains(clusters.get(0).getZone());
assertThat(tagValueStrings).contains(clusters.get(0).getId());

}

same for below

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated!

@product-auto-label product-auto-label Bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Jan 23, 2023
@product-auto-label product-auto-label Bot added size: s Pull request size is small. and removed size: m Pull request size is medium. labels Jan 23, 2023
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Jan 23, 2023
@mutianf mutianf added the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 23, 2023
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 23, 2023
@gcf-owl-bot gcf-owl-bot Bot requested a review from a team January 23, 2023 18:02
@mutianf mutianf merged commit b2ad72e into googleapis:main Jan 23, 2023
@mutianf mutianf deleted the flaky-test branch January 23, 2023 18:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: bigtable Issues related to the googleapis/java-bigtable API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants