Bug 38391

Summary: JMeterThread.delay() truncates long to int.
Product: JMeter - Now in Github Reporter: John Bullock <jbullock>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 2.1.1   
Target Milestone: ---   
Hardware: Other   
OS: other   
Attachments: Patch (context diff) fixing the 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.
Comment 3 The ASF infrastructure team 2022-09-24 20:37:36 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/1671