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

KEYCLOAK-4278 Testsuite failures with -Pauth-server-wildfly #3944

Closed
wants to merge 1 commit into from

Conversation

mstruk
Copy link
Contributor

@mstruk mstruk commented Mar 13, 2017

  • Fixed timeouts in tests involving sending of emails
  • Excluded one test requiring auth-server-undertow from executing as part of auth-server-wildfly

@@ -199,5 +199,12 @@
</plugins>

</build>

<profiles>
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a separate JIRA to fix this test. We should not exclude it like this, but rather the test needs fixing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stianst True, that part is a temporary solution. I can remove it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove it

@stianst stianst self-assigned this Mar 14, 2017
@mstruk
Copy link
Contributor Author

mstruk commented Mar 14, 2017

It's been removed.

@stianst
Copy link
Contributor

stianst commented Mar 15, 2017

Actually, I don't think this is the correct approach at all. Graphene has different waits depending of the type of request. The problem isn't the "page load" timeout. It's that the tests are using the wrong timeout.

@pdrozd can you confirm?

@stianst stianst assigned pdrozd and unassigned stianst Mar 15, 2017
@pdrozd
Copy link
Contributor

pdrozd commented Mar 15, 2017

@mstruk The default page load timeout is set to 10s and I think this is sufficient for almost all the tests. Are these tests fail on your local machine? On jenkins the tests are passing.
If these tests are failing regularly, there should be different problem, which needs to be solved rather than increasing the page load timeout.

@mstruk
Copy link
Contributor Author

mstruk commented Mar 15, 2017

On my machine these tests actually take longer than 10 secs to complete when auth-server-wildfly is activated. I couldn't quite get to the bottom of it but I suspect some lazy init of some provider to do with sending secured emails might be to blame. I can try and explore some more to better understand where the time is getting lost.

@mstruk
Copy link
Contributor Author

mstruk commented Mar 15, 2017

More specifically, waiting for validate email required action which renders and email, and sends it as part of processing of HTTP request takes longer than 10 seconds. Not sure why.

@stianst
Copy link
Contributor

stianst commented Apr 24, 2017

Something truly weird must be happening on your machine @mstruk. I can't see how it should take 10+ seconds to send en email with a test server.

@mstruk
Copy link
Contributor Author

mstruk commented Apr 24, 2017

Whatever it is, it only causes tests that send emails to fail.
I'll do some profiling to pin down the root cause.

@mstruk
Copy link
Contributor Author

mstruk commented Apr 26, 2017

The problem is apparently incredibly long local hostname resolution on my system:

   java.lang.Thread.State: RUNNABLE
	at java.net.Inet4AddressImpl.getLocalHostName(Native Method)
	at java.net.InetAddress.getLocalHost(InetAddress.java:1474)
	at javax.mail.internet.InternetAddress.getLocalHostName(InternetAddress.java:568)
	at javax.mail.internet.InternetAddress._getLocalAddress(InternetAddress.java:547)
	at javax.mail.internet.InternetAddress.getLocalAddress(InternetAddress.java:518)
	at javax.mail.internet.UniqueValue.getUniqueMessageIDValue(UniqueValue.java:100)
	at javax.mail.internet.MimeMessage.updateMessageID(MimeMessage.java:2172)
	at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:2200)
	- locked <0x00000007bc1ac900> (a com.sun.mail.smtp.SMTPMessage)
	at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:2159)
	at org.keycloak.email.DefaultEmailSenderProvider.send(DefaultEmailSenderProvider.java:132)
	at org.keycloak.email.freemarker.FreeMarkerEmailTemplateProvider.send(FreeMarkerEmailTemplateProvider.java:191)
   java.lang.Thread.State: RUNNABLE
	at java.net.Inet4AddressImpl.getLocalHostName(Native Method)
	at java.net.InetAddress.getLocalHost(InetAddress.java:1474)
	at com.sun.mail.smtp.SMTPTransport.getLocalHost(SMTPTransport.java:255)
	- locked <0x00000007bc3756f8> (a com.sun.mail.smtp.SMTPTransport)
	at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:703)
	- locked <0x00000007bc3756f8> (a com.sun.mail.smtp.SMTPTransport)
	at javax.mail.Service.connect(Service.java:366)
	- locked <0x00000007bc3756f8> (a com.sun.mail.smtp.SMTPTransport)
	at javax.mail.Service.connect(Service.java:246)
	at javax.mail.Service.connect(Service.java:195)
	at org.keycloak.email.DefaultEmailSenderProvider.send(DefaultEmailSenderProvider.java:139)
	at org.keycloak.email.freemarker.FreeMarkerEmailTemplateProvider.send(FreeMarkerEmailTemplateProvider.java:191)

I found more info and a solution.

I'm closing this issue.

@mstruk mstruk closed this Apr 26, 2017
123445666 pushed a commit to 123445666/keycloak that referenced this pull request Mar 10, 2023
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

3 participants