Skip to content

Adds TimeoutTest #304

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

Merged
merged 3 commits into from
Jul 20, 2015
Merged

Adds TimeoutTest #304

merged 3 commits into from
Jul 20, 2015

Conversation

eed3si9n
Copy link
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
Copy link
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
Copy link
Owner Author

eed3si9n commented Feb 3, 2015

Works for me.

$ sbt
...
root> project integration
integration> scalaVersion
[info] 2.11.4
integration> testOnly TimeoutTest

@joescii
Copy link
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
Copy link
Owner Author

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
Copy link
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
Copy link
Owner Author

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
Copy link
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.

eed3si9n added a commit that referenced this pull request Jul 20, 2015
@eed3si9n eed3si9n merged commit e84dfc5 into master Jul 20, 2015
@eed3si9n eed3si9n deleted the topic/timeout branch July 20, 2015 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants