Skip to content

Commit

Permalink
add exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner committed Oct 12, 2023
1 parent b2dc172 commit 4db44e4
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/general/LoadTest.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,32 @@ component extends="org.lucee.cfml.test.LuceeTestCase" {
throw "repetitition or thread count need to be bigger than 1";

var names = [];
var exceptions = [];
for (var i = 1; i <= arguments.repetitition; i++) {
for (var y = 1; y <= arguments.threadcount; y++) {
var name="testThread:#i#:#y#";
arrayAppend(names, name);
thread action="run" name=name udf=code args=arguments {
udf(argumentCollection:args);
thread action="run" name=name udf=code args=arguments exceptions=exceptions {
try {
udf(argumentCollection:args);
}
catch(e) {
arrayAppend(exceptions, e);
}

}
}
}
thread action="join" name=arrayToList(names);

if(len(exceptions)) {
throw exceptions[1];
}
}

private function code() {
systemOutput("execute the code",1,1);
throw "upsi dupsi!";
}

}

0 comments on commit 4db44e4

Please sign in to comment.