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

Use SystemMaterializer in AkkaSpecWithMaterializer #3075

Merged
merged 2 commits into from
May 11, 2020

Conversation

jrudolph
Copy link
Member

Currently fails, pushing that here to make sure I remember to fix it enventually.

@akka-ci akka-ci added validating PR that is currently being validated by Jenkins needs-attention Indicates a PR validation failure (set by CI infrastructure) and removed validating PR that is currently being validated by Jenkins labels Apr 16, 2020
@akka-ci
Copy link

akka-ci commented Apr 16, 2020

Test FAILed.

Pull request validation report

Failed Test Suites

Test result for 'akka-http-core / Pr-validation / ./ executeTests'

[info] ScalaTest
[info] Run completed in 4 minutes, 1 second.
[info] Total number of tests run: 1045
[info] Suites: completed 75, aborted 0  Scopes: pending 1
[info] Tests: succeeded 1043, failed 2, canceled 1, ignored 2, pending 56
[info] *** 2 TESTS FAILED ***
[error] Failed: Total 1045, Failed 2, Errors 0, Passed 1043, Ignored 2, Canceled 1, Pending 56
[error] Failed tests:
[error] 	akka.http.impl.engine.client.ClientCancellationSpec

@jrudolph jrudolph force-pushed the system-materializer-in-test branch from 710ac28 to f8aaaa0 Compare April 21, 2020 12:52
@jrudolph
Copy link
Member Author

I thought let's fix this quickly but it was actually quite a ride due to akka/akka#28691 and other issues with assertAllStagesStopped.

@akka-ci akka-ci added validating PR that is currently being validated by Jenkins and removed needs-attention Indicates a PR validation failure (set by CI infrastructure) labels Apr 21, 2020
@jrudolph jrudolph force-pushed the system-materializer-in-test branch from f8aaaa0 to 7b10178 Compare April 21, 2020 12:53
@akka-ci akka-ci added needs-attention Indicates a PR validation failure (set by CI infrastructure) validating PR that is currently being validated by Jenkins tested PR that was successfully built and tested by Jenkins and removed validating PR that is currently being validated by Jenkins needs-attention Indicates a PR validation failure (set by CI infrastructure) labels Apr 21, 2020
@akka-ci
Copy link

akka-ci commented Apr 21, 2020

Test PASSed.

@jrudolph jrudolph marked this pull request as ready for review April 22, 2020 08:02
 * use a proper test setup
 * enable TLS tests

Why was the extra materializer needed? To make sure assertAllStagesStopped
doesn't stumble over long-running streams (server binding and pool). Now
using assertAllStagesStopped is a bit useless as we force more of the background
resources to terminate but still cannot hurt.

If assertAllStagesStopped fails with weird errors (or just an ask timeout turns
up), it's probably because TlsActor doesn't support assertAllStagesStopped.
See akka/akka#28691
@jrudolph jrudolph force-pushed the system-materializer-in-test branch from 7b10178 to 8ce3169 Compare April 22, 2020 08:09
"Http client connections" must {
val address = Await.result(
Copy link
Member Author

Choose a reason for hiding this comment

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

Initialization has been moved to the bottom.

class ClientCancellationSpec extends AkkaSpecWithMaterializer {
// TODO document why this explicit materializer is needed here?
Copy link
Member Author

Choose a reason for hiding this comment

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

Extra materializer is not needed any more (see explanation in commit message)

@akka-ci akka-ci added validating PR that is currently being validated by Jenkins and removed tested PR that was successfully built and tested by Jenkins labels Apr 22, 2020
})

"support cancellation in simple outgoing connection with TLS" in Utils.assertAllStagesStopped(new TestSetup {
pending
Copy link
Member Author

Choose a reason for hiding this comment

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

Didn't manage to fix this test here, since Utils.assertAllStagesStopped is completely broken with TlsModule in place, it was impossible for now to debug what's going on.

* A client transport that will rewrite the target address to a fixed address. This can be used
* to pretend to connect to akka.example.org which is required to connect to the example server certificate.
*/
def proxyTransport(realAddress: InetSocketAddress): ClientTransport =
Copy link
Member Author

Choose a reason for hiding this comment

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

Ported the trick we used in alpakka to be to test TLS hostname verification in tests.

@akka-ci akka-ci added tested PR that was successfully built and tested by Jenkins and removed validating PR that is currently being validated by Jenkins labels Apr 22, 2020
@akka-ci
Copy link

akka-ci commented Apr 22, 2020

Test PASSed.

Copy link
Member

@ennru ennru left a comment

Choose a reason for hiding this comment

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

LGTM.

@jrudolph jrudolph removed the request for review from ignasi35 April 23, 2020 09:16
@raboof raboof merged commit 15f108c into akka:master May 11, 2020
@jrudolph jrudolph deleted the system-materializer-in-test branch May 11, 2020 11:48
jrudolph added a commit to jrudolph/akka-http that referenced this pull request May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tested PR that was successfully built and tested by Jenkins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants