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

Flaky io.trino.tests.jdbc.TestExternalAuthorizerOAuth2 #6991

Closed
s2lomon opened this issue Feb 22, 2021 · 8 comments
Closed

Flaky io.trino.tests.jdbc.TestExternalAuthorizerOAuth2 #6991

s2lomon opened this issue Feb 22, 2021 · 8 comments
Assignees
Labels
bug Something isn't working jdbc Relates to Trino JDBC driver test

Comments

@s2lomon
Copy link
Member

s2lomon commented Feb 22, 2021

Main reason of supposed flakiness is the Selenium WebDriver. This test has a lot of value, but there is a possibility that it will be flaky (it has failed at least once during review process). The plan is to monitor its flakiness and replace it at one point with something less flaky than selenium web driver, if its flakiness will be proved. Similar flaky test: #6223

@s2lomon s2lomon added bug Something isn't working test jdbc Relates to Trino JDBC driver labels Feb 22, 2021
@s2lomon s2lomon self-assigned this Feb 22, 2021
@kokosing
Copy link
Member

One idea is to replace Selenium with plain HTTP client. Where we it will be easier to control and debug. However:

  • it might require more work to support different IdP or reuse tests for that for different IdP.
  • it might require more work when change used IdP version.

Possibly we could reuse some IdP REST API, but REST API is very specific to IdP. So it is not portable at all.

@findepi
Copy link
Member

findepi commented Feb 23, 2021

I understand this flaky test is being added in #6917. I do hope we will have some sufficient mitigation (e.g. retries) in place before it gets merged. We have enough flaky tests problems already.

@kokosing
Copy link
Member

I understand this flaky test is being added in #6917.

It is is using Selenium, so there is a risk it is flaky. We don't know that yet if it is flaky or not for sure.

@s2lomon
Copy link
Member Author

s2lomon commented Feb 23, 2021

Repeats there are tricky, as we can never be sure 100%, what state will we be left in, with only part of the flow successful. The best option seems to be start over from scratch.

@kokosing
Copy link
Member

The best option seems to be start over from scratch.

As I understand you mean to restart the test (by using @Flaky) not the restart entire testing environment, right?

@findepi
Copy link
Member

findepi commented Aug 2, 2021

see #8739 (comment)

@findepi
Copy link
Member

findepi commented Nov 29, 2021

https://github.com/trinodb/trino/runs/4350956840?check_suite_focus=true

tests               | 2021-11-29 14:46:19 INFO: FAILURE     /    io.trino.tests.product.jdbc.TestExternalAuthorizerOAuth2.shouldAuthenticateAndExecuteQuery (Groups: profile_specific_tests, oauth2) took 2 minutes and 5 seconds
tests               | 2021-11-29 14:46:19 SEVERE: Failure cause:
tests               | java.sql.SQLException: Error executing query
tests               | 	at io.trino.jdbc.TrinoStatement.internalExecute(TrinoStatement.java:287)
tests               | 	at io.trino.jdbc.TrinoStatement.execute(TrinoStatement.java:240)
tests               | 	at io.trino.jdbc.TrinoPreparedStatement.<init>(TrinoPreparedStatement.java:119)
tests               | 	at io.trino.jdbc.TrinoConnection.prepareStatement(TrinoConnection.java:159)
tests               | 	at io.trino.tests.product.jdbc.TestExternalAuthorizerOAuth2.shouldAuthenticateAndExecuteQuery(TestExternalAuthorizerOAuth2.java:81)
tests               | 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
tests               | 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
tests               | 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
tests               | 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
tests               | 	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104)
tests               | 	at org.testng.internal.Invoker.invokeMethod(Invoker.java:645)
tests               | 	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:851)
tests               | 	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1177)
tests               | 	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
tests               | 	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
tests               | 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
tests               | 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
tests               | 	at java.base/java.lang.Thread.run(Thread.java:829)
tests               | Caused by: java.io.UncheckedIOException: java.net.SocketTimeoutException: timeout
tests               | 	at io.trino.jdbc.$internal.client.auth.external.HttpTokenPoller.pollForToken(HttpTokenPoller.java:85)
tests               | 	at io.trino.jdbc.$internal.client.auth.external.ExternalAuthentication.obtainToken(ExternalAuthentication.java:51)
tests               | 	at io.trino.jdbc.$internal.client.auth.external.ExternalAuthenticator.lambda$authenticate$0(ExternalAuthenticator.java:67)
tests               | 	at io.trino.jdbc.$internal.client.auth.external.LocalKnownToken.setupToken(LocalKnownToken.java:44)
tests               | 	at io.trino.jdbc.$internal.client.auth.external.ExternalAuthenticator.authenticate(ExternalAuthenticator.java:61)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.http.RetryAndFollowUpInterceptor.followUpRequest(RetryAndFollowUpInterceptor.java:230)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:119)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
tests               | 	at io.trino.jdbc.$internal.client.auth.external.ExternalAuthenticator.intercept(ExternalAuthenticator.java:84)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
tests               | 	at io.trino.jdbc.$internal.client.OkHttpUtil.lambda$userAgent$0(OkHttpUtil.java:69)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
tests               | 	at io.trino.jdbc.$internal.okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229)
tests               | 	at io.trino.jdbc.$internal.okhttp3.RealCall.execute(RealCall.java:81)
tests               | 	at io.trino.jdbc.$internal.client.JsonResponse.execute(JsonResponse.java:130)
tests               | 	at io.trino.jdbc.$internal.client.StatementClientV1.<init>(StatementClientV1.java:109)
tests               | 	at io.trino.jdbc.$internal.client.StatementClientFactory.newStatementClient(StatementClientFactory.java:24)
tests               | 	at io.trino.jdbc.TrinoConnection.startQuery(TrinoConnection.java:750)
tests               | 	at io.trino.jdbc.TrinoStatement.internalExecute(TrinoStatement.java:252)
tests               | 	... 17 more
tests               | Caused by: java.net.SocketTimeoutException: timeout
tests               | 	at io.trino.jdbc.$internal.okio.Okio$4.newTimeoutException(Okio.java:232)
tests               | 	at io.trino.jdbc.$internal.okio.AsyncTimeout.exit(AsyncTimeout.java:276)
tests               | 	at io.trino.jdbc.$internal.okio.AsyncTimeout$2.read(AsyncTimeout.java:243)
tests               | 	at io.trino.jdbc.$internal.okio.RealBufferedSource.indexOf(RealBufferedSource.java:358)
tests               | 	at io.trino.jdbc.$internal.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:230)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.http1.Http1ExchangeCodec.readHeaderLine(Http1ExchangeCodec.java:242)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders(Http1ExchangeCodec.java:213)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.java:115)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:94)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:43)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
tests               | 	at io.trino.jdbc.$internal.client.OkHttpUtil.lambda$
tests               | userAgent$0(OkHttpUtil.java:69)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
tests               | 	at io.trino.jdbc.$internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
tests               | 	at io.trino.jdbc.$internal.okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229)
tests               | 	at io.trino.jdbc.$internal.okhttp3.RealCall.execute(RealCall.java:81)
tests               | 	at io.trino.jdbc.$internal.client.JsonResponse.execute(JsonResponse.java:130)
tests               | 	at io.trino.jdbc.$internal.client.auth.external.HttpTokenPoller.executeRequest(HttpTokenPoller.java:152)
tests               | 	at io.trino.jdbc.$internal.client.auth.external.HttpTokenPoller.executePoll(HttpTokenPoller.java:133)
tests               | 	at io.trino.jdbc.$internal.client.auth.external.HttpTokenPoller.lambda$pollForToken$2(HttpTokenPoller.java:81)
tests               | 	at io.trino.jdbc.$internal.net.jodah.failsafe.Functions.lambda$get$0(Functions.java:48)
tests               | 	at io.trino.jdbc.$internal.net.jodah.failsafe.RetryPolicyExecutor.lambda$supply$0(RetryPolicyExecutor.java:62)
tests               | 	at io.trino.jdbc.$internal.net.jodah.failsafe.Execution.executeSync(Execution.java:129)
tests               | 	at io.trino.jdbc.$internal.net.jodah.failsafe.FailsafeExecutor.call(FailsafeExecutor.java:376)
tests               | 	at io.trino.jdbc.$internal.net.jodah.failsafe.FailsafeExecutor.get(FailsafeExecutor.java:67)
tests               | 	at io.trino.jdbc.$internal.client.auth.external.HttpTokenPoller.pollForToken(HttpTokenPoller.java:81)
tests               | 	... 38 more
tests               | 
tests               | 2021-11-29 14:46:19 WARNING: Tests from io.trino.tests.product.jdbc.TestExternalAuthorizerOAuth2 took 2.82m
tests               | 2021-11-29 14:46:19 INFO: 
tests               | 2021-11-29 14:46:19 INFO: Completed 2 tests
tests               | 2021-11-29 14:46:19 INFO: 1 SUCCEEDED      /      1 FAILED      /      0 SKIPPED
tests               | 2021-11-29 14:46:19 INFO: Tests execution took 2 minutes and 51 seconds

cc @s2lomon

@kokosing
Copy link
Member

CC: @Praveen2112 as you recently added more environemnts.

Maybe we should use playwright here.

lukasz-walkiewicz added a commit to lukasz-walkiewicz/presto that referenced this issue Jan 24, 2022
Instead of using selenium driver to log in and accept the consent request
use a simple python implementation which accepts all requests thus
eliminating the need of web driver entirely.
Fixes trinodb#6991
sopel39 pushed a commit to starburstdata/trino that referenced this issue Jan 25, 2022
Instead of using selenium driver to log in and accept the consent request
use a simple python implementation which accepts all requests thus
eliminating the need of web driver entirely.
Fixes trinodb#6991
rice668 pushed a commit to rice668/trino that referenced this issue Jan 31, 2023
Instead of using selenium driver to log in and accept the consent request
use a simple python implementation which accepts all requests thus
eliminating the need of web driver entirely.
Fixes trinodb#6991
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working jdbc Relates to Trino JDBC driver test
Development

No branches or pull requests

3 participants