Bug 38391 - JMeterThread.delay() truncates long to int.
Summary: JMeterThread.delay() truncates long to int.
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.1.1
Hardware: Other other
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
Depends on:
Reported: 2006-01-25 23:58 UTC by John Bullock
Modified: 2006-01-25 15:31 UTC (History)
0 users

Patch (context diff) fixing the bug (641 bytes, patch)
2006-01-26 00:31 UTC, John Bullock
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Bullock 2006-01-25 23:58:03 UTC
In JMeterThread.delay(), as the packed Timers are iterated and their delays 
accumulated, the long returned by Timer.delay() is truncated to an int. 
In normal jmeter operation this is not a problem, since delays are short.  In 
my use of jmeter, two custom timers are used whose delays partially cancel (one 
returns a negative value) to produce the actual delay for the sampler.  The use 
of an int to accumulate the two long values produces the wrong delay for the 
samplers in my test plans. 
The fix is to simply change the type of the sum local variable from int to 
long.  I have a local patch on version 1.9.1.  I can provide a patch for the 
current head revision.
Comment 1 Sebb 2006-01-26 00:16:52 UTC
Good catch - fixed in 2.1 branch (will be in 2.1.2)
Comment 2 John Bullock 2006-01-26 00:31:47 UTC
Created attachment 17505 [details]
Patch (context diff) fixing the bug

Patch is on Revision 350089 of JMeterThread.java.