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

Adds TimeoutTest #304

Merged
merged 3 commits into from Jul 20, 2015

Conversation

Projects
None yet
2 participants
@eed3si9n
Owner

eed3si9n commented Jan 28, 2015

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

This comment has been minimized.

Show comment
Hide comment
@joescii

joescii Feb 2, 2015

Contributor

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?

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

This comment has been minimized.

Show comment
Hide comment
@eed3si9n

eed3si9n Feb 3, 2015

Owner

Works for me.

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

eed3si9n commented Feb 3, 2015

Works for me.

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

This comment has been minimized.

Show comment
Hide comment
@joescii

joescii Feb 3, 2015

Contributor

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.

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

This comment has been minimized.

Show comment
Hide comment
@eed3si9n

eed3si9n Feb 3, 2015

Owner

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)
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

This comment has been minimized.

Show comment
Hide comment
@joescii

joescii Feb 3, 2015

Contributor

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.

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

This comment has been minimized.

Show comment
Hide comment
@eed3si9n

eed3si9n Feb 3, 2015

Owner

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?

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

This comment has been minimized.

Show comment
Hide comment
@joescii

joescii Feb 3, 2015

Contributor

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.

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

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