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

Add tests for multiple routes #7563

Merged
merged 3 commits into from Dec 24, 2022
Merged

Conversation

yschimke
Copy link
Collaborator

Test for IPv4, IPv6 multiple routes. When the RouteDatabase is updated, how many follow up requests are made.

@yschimke
Copy link
Collaborator Author

Using this to test

#7553
and
#7530

import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.RegisterExtension

@Flaky
Copy link
Member

Choose a reason for hiding this comment

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

eep

Copy link
Member

Choose a reason for hiding this comment

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

Is this due to raciness in fast fallback? I wonder if we can add something to make it less racy, like changing the timeouts to MAX_VALUE or 0 or something

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sorry, not Flaky. I'm just using it for logging the tracing.

okhttp/src/jvmTest/java/okhttp3/RouteFailureTest.kt Outdated Show resolved Hide resolved
.assertBody("body")

assertThat(client.routeDatabase.failedRoutes).isEmpty()
// TODO check if we expect a second request to server1, before attempting server2
Copy link
Member

Choose a reason for hiding this comment

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

Yep

Copy link
Member

Choose a reason for hiding this comment

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

(I think that’s the behavior we should test for, though we could create an issue and change that)

import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.RegisterExtension

@Flaky
Copy link
Member

Choose a reason for hiding this comment

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

Is this due to raciness in fast fallback? I wonder if we can add something to make it less racy, like changing the timeouts to MAX_VALUE or 0 or something

}
}

class SpecificHostSocketFactory(
Copy link
Member

Choose a reason for hiding this comment

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

Promote to its own file?

Copy link
Member

Choose a reason for hiding this comment

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

This is a great idea BTW

@yschimke yschimke merged commit f27a291 into square:master Dec 24, 2022
@yschimke yschimke deleted the check_database branch May 27, 2023 11:25
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.

None yet

2 participants