|
From: Tomas G. <to...@pr...> - 2013-08-28 12:21:59
|
Hi,
We use this class in performance tests. We have not seen any issues with
it so far.
Cheers,
Tomas
On 08/24/2013 01:43 AM, Jing Xu wrote:
> Hi everyone,
>
> I am developing a software testing tool to detect thread stress
> vulnerability of server application. And our tool detects the
> vulnerability on ejbca in following function in
> java.org.ejbca.util.PerformanceTest.TestInstance:
>
> public void run(){
>
> PerformanceTest.this.log.info
> <http://performancetest.this.log.info/>("Thread nr " + this.nr
> <http://this.nr/> + " started.");
>
> while (true) {
>
> try {
>
> final long startTime=new Date().getTime();
>
> Command failingCommand=null;
>
> for (int i=0; failingCommand == null && i < this.commands.length;
> i++) {
>
> if (this.maxWaitTime > 0) {
>
> final int waitTime=(int)(this.maxWaitTime *
> PerformanceTest.this.random.nextFloat());
>
> if (waitTime > 0) {
>
> synchronized (this) {
>
> wait(waitTime);
>
> }
>
> this.statistic.addTime("Time waiting between jobs",waitTime);
>
> }
>
> }
>
> final Command command=this.commands[i];
>
> final JobRunner jobRunner=new JobRunner(command);
>
> if (!jobRunner.execute()) {
>
> failingCommand=command;
>
> }
>
>
> this.statistic.addTime(command.getJobTimeDescription(),jobRunner.getTimeConsumed());
>
> }
>
> String sResult="Test in thread " + this.nr <http://this.nr/> + "
> completed ";
>
> if (failingCommand == null) {
>
> this.statistic.taskFinished();
>
> sResult+="successfully";
>
> }
>
> else {
>
> this.statistic.taskFailed();
>
> sResult+="but failed when the command '" +
> failingCommand.getClass().getCanonicalName() + "' was executed";
>
> }
>
> sResult+=". The time it took was " + (new Date().getTime() -
> startTime) + " ms.";
>
> if (failingCommand == null) {
>
> PerformanceTest.this.log.info
> <http://performancetest.this.log.info/>(sResult);
>
> }
>
> else {
>
> PerformanceTest.this.log.error(sResult);
>
> }
>
> }
>
> catch ( Throwable t) {
>
> this.statistic.taskFailed();
>
> PerformanceTest.this.log.error("Exeption in thread " + this.nr
> <http://this.nr/> + ".",t);
>
> }
>
> }
>
> }
>
> Is it possible that jobRunner.execute() will create unbounded number of
> threads? Thanks advanced for your help.
>
> Best,
> Jing
>
>
> ------------------------------------------------------------------------------
> Introducing Performance Central, a new site from SourceForge and
> AppDynamics. Performance Central is your source for news, insights,
> analysis and resources for efficient Application Performance Management.
> Visit us today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
>
>
>
> _______________________________________________
> Ejbca-develop mailing list
> Ejb...@li...
> https://lists.sourceforge.net/lists/listinfo/ejbca-develop
>
|