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

Added SetRoundtripDuration function to Mockcluster to configure the round-trip duration #892

Merged
merged 2 commits into from
Nov 8, 2022

Conversation

kkoehler
Copy link
Contributor

@kkoehler kkoehler commented Nov 7, 2022

Added a SetRoundtripDuration wrapper function to the Mockcluster implementation by which the roundtrip duration can be configured. This can be used to test timeout handling for requests.

…ion for a single broker. this can be used for timeout testing
@kkoehler kkoehler changed the title Added SetRoundtripDuration function to configure the round-trip duration Added SetRoundtripDuration function to Mockcluster to configure the round-trip duration Nov 7, 2022
// SetRoundtripDuration sets the broker round-trip-time delay for the given broker.
func (mc *MockCluster) SetRoundtripDuration(brokerId int, duration time.Duration) {
durationInMillis := C.int(duration.Milliseconds())
C.rd_kafka_mock_broker_set_rtt(mc.mcluster, C.int(brokerId), durationInMillis)
Copy link
Contributor

Choose a reason for hiding this comment

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

The error should be returned

@kkoehler
Copy link
Contributor Author

kkoehler commented Nov 7, 2022

uupps... sorry for that.
was so happy that we're able to test timeouts ;-)

Copy link
Contributor

@edenhill edenhill left a comment

Choose a reason for hiding this comment

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

LGTM!

@edenhill edenhill merged commit 4b799a0 into confluentinc:master Nov 8, 2022
@edenhill
Copy link
Contributor

edenhill commented Nov 8, 2022

Thank you!

PrasanthV454 pushed a commit that referenced this pull request Jan 12, 2023
…ound-trip duration (#892)

* added SetRoundtripDuration function to configure the round-trip duration for a single broker. this can be used for timeout testing

* added error handling to SetRoundtripDuration function
PrasanthV454 pushed a commit that referenced this pull request Mar 17, 2023
…ound-trip duration (#892)

* added SetRoundtripDuration function to configure the round-trip duration for a single broker. this can be used for timeout testing

* added error handling to SetRoundtripDuration function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants