Code Monkey home page Code Monkey logo

asynctest's People

Contributors

rkuhn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

asynctest's Issues

add percentile assertions

It should be possible to state that the n-th percentile execution time of the test method does not exceed a certain value. This must be in addition to checking that none of the executions take longer than the maximum wait time (in order to bound test time). It also means that the test procedure will have to be invoked a large number of times (at least several hundred—also configurable, possibly taking into account warm-up rounds) and this implies that we will also have to limit the number of concurrent invocations to match the expected service capacity.

investigate how stack traces can be improved

Consider the following test case:

  private def flop = async { assert(false, "this is FALSE") } // <--- SomeTests.scala:14

  @Test def two = async {
    val x = await(op)
    val y = await(flop).toString
    val z = await(op)
    val w = x + z
    y + w
  }

Currently the stack trace reported looks like this:

java.lang.AssertionError: assertion failed: this is FALSE
    at scala.Predef$.assert(Predef.scala:165)
    at com.rolandkuhn.asynctest.SomeTests$$anonfun$com$rolandkuhn$asynctest$SomeTests$$flop$1.apply$mcV$sp(SomeTests.scala:14)
    at com.rolandkuhn.asynctest.SomeTests$$anonfun$com$rolandkuhn$asynctest$SomeTests$$flop$1.apply(SomeTests.scala:14)
    at com.rolandkuhn.asynctest.SomeTests$$anonfun$com$rolandkuhn$asynctest$SomeTests$$flop$1.apply(SomeTests.scala:14)
    at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
    at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
    at scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask.exec(ExecutionContextImpl.scala:121)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.pollAndExecAll(ForkJoinPool.java:1253)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1346)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

It would be nicer if we could somehow wrap the exception at the line which contains await(flop), giving the user a better clue what went wrong.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.