Hi,
with snapshot from the 24th,
If I have the following simulation which (for test case purposes only, normally it would find file paths) doesn’t find any data,
Gatling fails with the errors below.
I am not totally sure why it throws the exception as with small changes to the code like removing the filter it appears to avoid the error. It’s not blocking me but thought it worth reporting the error.
Thanks,
Alex
def matchesExtension(file: File, extensions: Set[String]) =
extensions.exists(ext => file.getName.toLowerCase.contains("." + ext))
def findPaths(root: String, extensions: Set[String]): Array[Map[String, String]] =
findFiles(new File(root))
.filter(matchesExtension(_, extensions))
.map(f => Map(“path” → f.getPath.drop(root.length)))
.toArray
def findFiles(f: File): Stream[File] = f #:: (Stream.empty)
val data = findPaths("/nowhere", Set(“txt”, “out”, “logs”)).random
val request = exec(
http(“req”).get(“req?${data}”))
)
val scn = scenario(“requests”)
.feed(data)
.exec(request)
---->
Simulation ASimulation started…