Quarkus: ci failures for BearerTokenAuthorizationTest

Created on 16 Oct 2019  路  17Comments  路  Source: quarkusio/quarkus

Describe the bug
CI native build for the mentioned test fails
Expected behavior
CI to pass

Screenshots

INFO] Running io.quarkus.it.keycloak.BearerTokenAuthorizationTest
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 4.282 s <<< FAILURE! - in io.quarkus.it.keycloak.BearerTokenAuthorizationTest
[ERROR] io.quarkus.it.keycloak.BearerTokenAuthorizationTest  Time elapsed: 4.282 s  <<< FAILURE!
java.lang.AssertionError: 
1 expectation failed.
Expected status code <201> but was <500>.

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

Additional context
the following PRs from https://github.com/quarkusio/quarkus/pull/4609 to https://github.com/quarkusio/quarkus/pull/4623 seems to have hit this failure.

kinbug

All 17 comments

I am seeing a lot of the hit this failure.

Hi All, this test passes on my machine; it appears thedocker-keycloak profile is taking awhile to complete the initialization of the KC server instance.

So it seems like some script is needed to wait for Keycloak to be full up?

@geoand may be have some wait code in the test, ping the KC server endpoint for 30 secs or so ? I can give a try

AFAICS, the OIDC test is run last and it's native tests so the ones before take time.

Not entirely sure this is the problem.

I haven't done any testing on this so my idea above might have been totally off :P

This fails with:

[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running io.quarkus.it.keycloak.BearerTokenAuthorizationTest
12:20:37.564 Keycloak:12:20:37,563 ERROR [org.keycloak.services.error.KeycloakErrorHandler] (default task-14) Uncaught server error: java.lang.RuntimeException: Script upload is disabled
12:20:37.564 Keycloak:  at [email protected]//org.keycloak.authorization.policy.provider.js.JSPolicyProviderFactory.updatePolicy(JSPolicyProviderFactory.java:125)
12:20:37.564 Keycloak:  at [email protected]//org.keycloak.authorization.policy.provider.js.JSPolicyProviderFactory.onImport(JSPolicyProviderFactory.java:70)
12:20:37.564 Keycloak:  at [email protected]//org.keycloak.models.utils.RepresentationToModel.toModel(RepresentationToModel.java:2232)
12:20:37.564 Keycloak:  at [email protected]//org.keycloak.authorization.AuthorizationProvider$3.create(AuthorizationProvider.java:351)

See https://dev.azure.com/quarkus-ci/quarkus/_build/results?buildId=9906&view=logs

@pedroigor FYI

@sberyozkin, This error should be fixed by passing the following system properties when booting the server:

-Dkeycloak.profile.feature.upload_scripts=enabled

Do you want me to send a PR ?

In fact, I think we can just remove the logic from test that is trying to create policies on the server. They seem to be irrelevant to what is being tested (they were there for the old extension).

@pedroigor Whatever you think is best.

My "fix" was just a quick bandaid to get us back to green CI :)

@geoand, it works too :)

But, as you know, we need to make sure we work with latest Keycloak version. So for OIDC, we don't need to deploy scripts to the server (but with the new extension I'm working).

@pedroigor yes of course! Thanks for the PR!

Guys you are too fast :-)

I am seeing a likely similar issue for these builds among others

The failure is

[INFO] Running io.quarkus.it.keycloak.BearerTokenAuthorizationTest
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.99 s <<< FAILURE! - in io.quarkus.it.keycloak.BearerTokenAuthorizationTest
[ERROR] io.quarkus.it.keycloak.BearerTokenAuthorizationTest  Time elapsed: 0.99 s  <<< ERROR!
java.net.ConnectException: Connection refused (Connection refused)
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:607)
    at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:121)
    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
    at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:326)
    at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:605)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:440)
Was this page helpful?
0 / 5 - 0 ratings