-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: set default 0 when get method timeout config #1422
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -150,6 +150,17 @@ public void convertProviderToUrls() throws Exception { | |
Assert.assertEquals(serverConfig3.getPort(), providerInfo3.getPort()); | ||
Assert.assertEquals(providerConfig.getAppName(), providerInfo3.getAttr(ProviderInfoAttrs.ATTR_APP_NAME)); | ||
Assert.assertEquals(providerConfig.getTimeout(), providerInfo3.getDynamicAttr(ProviderInfoAttrs.ATTR_TIMEOUT)); | ||
|
||
ProviderConfig<?> providerConfig2 = new ProviderConfig<>(); | ||
providerConfig2.setMethods(new HashMap<>()); | ||
providerConfig2.getMethods().put("test", new MethodConfig().setTimeout(null)); | ||
Assert.assertNotNull(providerConfig2.getTimeout()); | ||
String s4 = SofaRegistryHelper.convertProviderToUrls(providerConfig2, serverConfig); | ||
Assert.assertNotNull(s3); | ||
ProviderInfo providerInfo4 = SofaRegistryHelper.parseProviderInfo(s4); | ||
Assert.assertEquals(0, providerInfo4.getDynamicAttr(".test.timeout")); | ||
Assert.assertFalse(providerConfig2.hasTimeout()); | ||
|
||
Comment on lines
+153
to
+163
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The modifications in the Would you like assistance in setting up integration tests for this scenario? |
||
} | ||
|
||
@Test | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding more test scenarios for robust testing.
The test method
testMethodTimeout
effectively checks the behavior whentimeout
isnull
. Consider adding more scenarios to ensure robust testing, such as verifying the actual timeout value used by the system whennull
is set.Would you like me to help create additional test cases for this scenario?