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

fix flaky test caused by timing issue #26795

Merged
merged 1 commit into from
Jan 30, 2022

Conversation

ZejiaJiang
Copy link
Member

@ZejiaJiang ZejiaJiang commented Jan 30, 2022

Description

The eventhub test triggered by core-ci is failed. It's a flaky test.

According to the other tests

// This is one less because the processEvent is called before the end span call, so it is possible for
// to reach this line without calling it the 5th time yet. (Timing issue.)
verify(tracer, atLeast(numberOfTimes - 1)).end(eq("success"), isNull(), any());

I found that processEvent and endSpan have the timing issue in
partitionProcessor.processEvent(new EventContext(partitionContext, eventData, checkpointStore,
eventContext.getLastEnqueuedEventProperties()));
if (logger.canLogAtLevel(LogLevel.VERBOSE)) {
logger.verbose("Completed processing event {}, {}", partitionContext.getEventHubName(),
partitionContext.getPartitionId());
}
endProcessTracingSpan(processSpanContext, Signal.complete());
} catch (Throwable throwable) {
/* user code for event processing threw an exception - log and bubble up */
endProcessTracingSpan(processSpanContext, Signal.error(throwable));

I take the same approach just like the other tests.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@ghost ghost added the Event Hubs label Jan 30, 2022
@ZejiaJiang
Copy link
Member Author

#26759

@ZejiaJiang
Copy link
Member Author

@lmolkova

@haolingdong-msft
Copy link
Member

LGTM.

@ZejiaJiang ZejiaJiang merged commit 9126604 into Azure:main Jan 30, 2022
@lmolkova
Copy link
Member

lmolkova commented Jan 31, 2022

@ZejiaJiang thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants