atlas-remote-test won't execute

Description

When running atlas-remote-test --server localhost -p 1990 --context-path confluence -u 8.0.0, this error occurs:

Environment

None

Testing Notes

Add notes...

Activity

Show:
Andrew S
May 4, 2020, 7:57 AM
Edited

Switching to Apache HttpComponents' HttpClient indeed fixes the problem:

Andrew S
May 3, 2020, 11:05 PM
Edited

I’ve replicated this on my machine using a demo project I put together, by running mvn amps:remote-test -Dserver=localhost -Dhttp.port=5990 -Dcontext.path=refapp (this is what atlas-remote-test runs under the hood).

FWIW, the test passes if I run it from IDEA (as expected, because AMPS is not being used in this scenario).

Thanks for finding the root cause, that’s really helpful.

Dennis Fischer
May 1, 2020, 11:50 AM
Edited

Root cause is a bug in Apache Wink 1.4 - BasicAuthSecurityHandler. The handler does an unauthenticated request. The request fails with 401. The request is retried with added Basic Authentication. However, the previous response Entity is not consumed. Thus, the java.lang.IllegalStateException is thrown.

Could be fixed by creating a custom basic auth handler instead, e.g.:

But dropping Apache Wink or redesigning RemoteTest might be another option.

Dennis Fischer
December 22, 2019, 6:52 PM

Just using response.consumeContent(); will not resolve the problem (tried that - does not work and runs into the same error). Replacing Apache Wink is one solution. Apache Wink is retired and only atlas-remote-test depends on it. Thus, replacing could be an easy option.

Chris Hansen
December 20, 2019, 12:52 AM

I wonder if a fix would be as easy as adding response.consumeContent(); after lines 314 and 328 in RemoteTestMojo. It seems plausible because the response body is never used.

Here’s the full stacktrace:

 

 

Fixed

Assignee

Andrew S

Reporter

Ashwal Dixit

Labels

None

Add-on Type

None

Team

None

CC

None

Risk factor

None

QA Kickoff Status

None

QA Demo Status

None

Story point estimate

None

Fix versions

Priority

Major