zalando-stups / play-zhewbacca

Play! framework library to protect REST endpoint by OAuth2 token verification - THIS PROJECT IS NOT LONGER ACTIVELY MAINTAINED
MIT License
22 stars 13 forks source link

Investigate: potential issue with circuit breaker or test framework in Play 2.6.3 #43

Open dmitrykrivaltsevich opened 6 years ago

dmitrykrivaltsevich commented 6 years ago

Following code was added in order to check Circuit Breaker behaviour in case when remote server operates slowly:

  def fakeApp(delay: Duration = 0.second, response: Result = Results.Ok): Application = {
    val routes: PartialFunction[(String, String), Handler] = {
      case ("GET", "/tokeninfo") => Action {
        Thread.sleep(delay.toMillis)
        response
      }
    }

When we used Play 2.5.* the test "should not return a Token Info when remote server operates slow" had a delay of 15 minutes. So intention was to show that the test completes in less than few seconds and don't wait all 15 minutes.

After upgrade to Play 2.6.3 this delay was set to 5 seconds because:

This might indicate that either test is somehow broken or Circuit Breaker doesn't work with a new Playframework or both. We need to find the cause, fix it and set delays back to previous value.