Adds TimeoutTest #304

Merged
merged 3 commits into from Jul 20, 2015

Projects

None yet

2 participants

@eed3si9n
Owner

This is in response to @joescii's post Configuring timeout for scalaxb.

TimeoutTest

  1. The test creates an Apache CXF SOAP service with fake Thread.sleep set to 3s to emulate a slightly-long-running process.
  2. The test bakes a special cake based on Joe's implementation. (I might actually make this the default impl) This introduces configurable timeouts set to 10s by default. Overridden to be 1s for the test.
  3. Future#failed projection is called to flip the success/failure state.
  4. The test awaits 10s for the client and server to play its course.

The test seems to be returning ExecutionException as expected.

@joescii
Contributor
joescii commented Feb 2, 2015

I grabbed this branch so I could run the tests locally. After publishing the app project locally, I switched to the integration project and ran test. It erupted with scalac sadness.

[init] error: error while loading Object, Missing dependency 'object scala in compiler mirror', required by C:\Program Files\Java\jdk1.8.0_25\jre\lib\rt.jar(java/lang/Object.class)

Failed to initialize compiler: object scala in compiler mirror not found.
** Note that as of 2.8 scala does not assume use of the java classpath.
** For the old behavior pass -usejavacp to scala, or if using a Settings
** object programatically, settings.usejavacp.value = true.
[info] CrossNamespaceTest
[info] ! xn.scala must compile so that CrossNamespaceChoice can be used
[error]  MissingRequirementError: : object scala in compiler mirror not found.  (CompilerMatcher.scala:79)
[error] CompilerMatcher$$anon$2.apply(CompilerMatcher.scala:79)
[error] CrossNamespaceTest$$anonfun$1.apply(CrossNamespaceTest.scala:19)
[error] CrossNamespaceTest$$anonfun$1.apply(CrossNamespaceTest.scala:19)

I tried out the suggestion of using -Dsettings.usejavacp.value=true. The problems are different but still present.

[info] CrossNamespaceTest
[info] ! xn.scala must compile so that CrossNamespaceChoice can be used
[error]  FatalError: : package scala does not have a member Int  (CompilerMatcher.scala:79)
[error] CompilerMatcher$$anon$2.apply(CompilerMatcher.scala:79)
[error] CrossNamespaceTest$$anonfun$1.apply(CrossNamespaceTest.scala:19)
[error] CrossNamespaceTest$$anonfun$1.apply(CrossNamespaceTest.scala:19)

I've yet to google anything helpful here. Do you have any initial thoughts regarding what I may be missing in my environment setup?

@eed3si9n
Owner
eed3si9n commented Feb 3, 2015

Works for me.

$ sbt
...
root> project integration
integration> scalaVersion
[info] 2.11.4
integration> testOnly TimeoutTest
@joescii
Contributor
joescii commented Feb 3, 2015

That's because you're the sbt Whisperer...

Early on I suspected my bastardized Windows platform. I should have pursued that more. I stumbled across this comment this morning, leading me back to that well. I hacked up something that got me further. I'll let you know what I come up with later today.

@eed3si9n
Owner
eed3si9n commented Feb 3, 2015

That's consistent with the last entry on the stack trace, which is CompilerMatcher.

I am using java.io.File.pathSeparator though.

    grs.bootclasspath.value = 
      (origBootclasspath :: bootPathList).mkString(java.io.File.pathSeparator)

    val originalClasspath = grs.classpath.value
    grs.classpath.value = classpathList.distinct.mkString(java.io.File.pathSeparator)
@joescii
Contributor
joescii commented Feb 3, 2015

I got straightened out in PR307. I confirmed what I needed to know, which is we can set the timeouts higher than the defaults. The branch is here, if you're the least bit interested.

@eed3si9n
Owner
eed3si9n commented Feb 3, 2015

Thanks for #307.
So the timeout generally works with scalaxb + Dispatch combo?
I've been thinking if people find it useful, I can make timeout client the default implementation. WDYT?

@joescii
Contributor
joescii commented Feb 3, 2015

Yes, the timeouts seem to work without any problems.

I think it's a good call to go with the timeout client. It took me a good bit of digging to figure out how to do it, considering scalaxb, dispatch, async-http, and netty are all (potentially) involved. It shouldn't hurt anything as long as the values are the same as the defaults.

added some commits Jan 28, 2015
@eed3si9n Adds TimeoutTest d26b65d
@eed3si9n Add requestTimeout and connectionTimeout to DispatchHttpClients/Dispa…
…tchHttpClientsAsync
95e2293
@eed3si9n bump up defaultDispatchVersion to 0.11.2
5e45c31
@eed3si9n eed3si9n merged commit e84dfc5 into master Jul 20, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@eed3si9n eed3si9n deleted the topic/timeout branch Jul 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment