Bug 569992 - Junit 3 execution time computed wrong
Summary: Junit 3 execution time computed wrong
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.19   Edit
Hardware: PC Windows 10
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-31 04:55 EST by Carsten Hammer CLA
Modified: 2023-01-06 18:24 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carsten Hammer CLA 2020-12-31 04:55:31 EST
Try the following snippet (plain junit 3 based test):

import junit.framework.TestCase;

public class Asdf extends TestCase {


	public void testTimer() {
		long starttime= System.currentTimeMillis();
		try {
			Thread.sleep(2000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		assertTrue((System.currentTimeMillis()-starttime)>2000);

	}
}


Running it using a run configuration for junit 3 sometimes shows execution time below 2000 milliseconds what is always wrong. Junit 4 sometimes shows exactly 2000 milliseconds and Junit 5 shows always more than 2000 milliseconds what seems to be OK.
Comment 1 Eclipse Genie CLA 2023-01-06 18:24:01 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.