[jboss-jira] [JBoss JIRA] (ELY-1529) OAuth2SaslClientV10Test or OAuth2SaslClientV11Test intermittently fails during MockWebServer binding

Jan Kalina (JIRA) issues at jboss.org
Fri Apr 20 11:44:00 EDT 2018


     [ https://issues.jboss.org/browse/ELY-1529?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jan Kalina reassigned ELY-1529:
-------------------------------

    Assignee: Jan Kalina


> OAuth2SaslClientV10Test or OAuth2SaslClientV11Test intermittently fails during MockWebServer binding
> ----------------------------------------------------------------------------------------------------
>
>                 Key: ELY-1529
>                 URL: https://issues.jboss.org/browse/ELY-1529
>             Project: WildFly Elytron
>          Issue Type: Bug
>          Components: Testsuite
>    Affects Versions: 1.2.0.Final
>            Reporter: Ondrej Lukas
>            Assignee: Jan Kalina
>
> OAuth2SaslClientV10Test or OAuth2SaslClientV11Test intermittently fails during MockWebServer binding, for example for OAuth2SaslClientV10Test:
> {code}
> java.net.BindException: Address already in use (Bind failed)
>  	at java.net.PlainSocketImpl.socketBind(Native Method)
>  	at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387)
>  	at java.net.ServerSocket.bind(ServerSocket.java:375)
>  	at okhttp3.mockwebserver.MockWebServer.start(MockWebServer.java:317)
>  	at okhttp3.mockwebserver.MockWebServer.start(MockWebServer.java:300)
>  	at okhttp3.mockwebserver.MockWebServer.start(MockWebServer.java:289)
>  	at org.wildfly.security.sasl.oauth2.OAuth2SaslClientV10Test.onBefore(OAuth2SaslClientV10Test.java:82)
> {code}
> When this happens it causes only one of test methods to fail. Other tests in OAuth2SaslClientV10Test/OAuth2SaslClientV11Test finish successfully. It seems this test issue is not depended on any platform or JDK.
> Part of log when test fails:
> {code}
> ...
> 04:44:06,995 TRACE (main) [org.wildfly.security] <ServerAuthenticationContext.java:1015> Handling AuthenticationCompleteCallback: succeed
> 04:44:06,995 TRACE (main) [org.wildfly.security] <ServerAuthenticationContext.java:1032> Handling SecurityIdentityCallback: identity = SecurityIdentity{principal=jdoe, securityDomain=org.wildfly.security.auth.server.SecurityDomain at e7f11d, authorizationIdentity=org.wildfly.security.auth.realm.token.TokenSecurityRealm$TokenRealmIdentity$1 at 3d687a, realmInfo=RealmInfo{name='oauth-realm', securityRealm=org.wildfly.security.auth.realm.token.TokenSecurityRealm at a370f4}, creationTime=2018-02-27T09:44:06.981Z}
> 04:44:06,996 INFO  (MockWebServer 50831) [okhttp3.mockwebserver.MockWebServer] <MockWebServer.java:349> MockWebServer[50831] done accepting connections: Socket closed
> 04:44:12,006 INFO  (MockWebServer 50831) [okhttp3.mockwebserver.MockWebServer] <MockWebServer.java:323> MockWebServer[50831] starting to accept connections
> 04:44:12,006 TRACE (main) [org.wildfly.security] <AuthenticationContextConfigurationClient.java:121> getAuthenticationConfiguration uri=protocol://test7.org, protocolDefaultPort=-1, abstractType=null, abstractTypeAuthority=null, MatchRule=[host=test7.org], AuthenticationConfiguration=[AuthenticationConfiguration:principal=anonymous,set-host=test7.org,set-protocol=protocol,credentials-present,providers-supplier=org.wildfly.security.auth.client.ElytronXmlParser$DeferredSupplier at 18ca3c8,mechanism-properties={wildfly.sasl.local-user.quiet-auth=true}]
> 04:44:12,008 TRACE (main) [org.wildfly.security] <SecurityProviderSaslClientFactory.java:114> Created SaslClient for mechanism OAUTHBEARER, using Provider WildFlyElytron and protocol protocol
> ...
> {code}
> It also causes that Exception is thrown during {{@After}} for the same test, example for OAuth2SaslClientV10Test:
> {code}
> java.io.IOException: Gave up waiting for executor to shut down
> 	at okhttp3.mockwebserver.MockWebServer.shutdown(MockWebServer.java:375)
> 	at org.wildfly.security.sasl.oauth2.OAuth2SaslClientV10Test.onAfter(OAuth2SaslClientV10Test.java:88)
> {code}
> After those exceptions in {{@Before}} and {{@After}} are thrown for some particular test then all following tests works correctly.



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list