fix MultiNodeSpec.getCallerName, #22186

* it didn't work with RemotingMultiNodeSpec
* that was breaking Artery performance plots
This commit is contained in:
Patrik Nordwall 2017-02-24 08:53:12 +01:00
parent 698b814c5d
commit 58acf7bf8f

View file

@ -234,7 +234,8 @@ object MultiNodeSpec {
}
private def getCallerName(clazz: Class[_]): String = {
val s = Thread.currentThread.getStackTrace map (_.getClassName) drop 1 dropWhile (_ matches ".*MultiNodeSpec.?$")
val pattern = s"(akka\\.remote\\.testkit\\.MultiNodeSpec.*|akka\\.remote\\.RemotingMultiNodeSpec)"
val s = Thread.currentThread.getStackTrace.map(_.getClassName).drop(1).dropWhile(_.matches(pattern))
val reduced = s.lastIndexWhere(_ == clazz.getName) match {
case -1 s
case z s drop (z + 1)