Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 367974

Summary: ConnectorTimeoutTest and subclasses use fixed maxIdleTime
Product: [RT] Jetty Reporter: Thomas Becker <tbecker>
Component: serverAssignee: Thomas Becker <tbecker>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: jetty-inbox
Version: unspecified   
Target Milestone: 7.5.x   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
proposed patch none

Description Thomas Becker CLA 2012-01-05 14:13:07 EST
Build Identifier: 

ConnectorTimeoutTests and it's subclasses successful execution depend on some brittle timing constraints. 

They all have a fixed maxIdleTimeout of 250ms hardcoded and each individual test contains some hardcoded timing information themselves based on that value.

Best solution would be to use CountDownlatches, Listeners, etc. to avoid timing issues. If that's not possible or too complicated at least stuff like Thread.sleep(someValue) should have someValue being calculated based on maxIdleTimeout instead of having them hardcoded. 

Reproducible: Always
Comment 1 Thomas Becker CLA 2012-01-06 08:10:22 EST
Created attachment 209127 [details]
proposed patch
Comment 2 Greg Wilkins CLA 2012-01-08 19:47:47 EST
applied.  but is there more work to do here?
Comment 3 Thomas Becker CLA 2012-01-09 04:19:12 EST
No, can be closed.

Refactoring it to make the test execute faster is not worth the work and code clutter it'll require IMHO.

Resolving the issue.
Comment 4 Thomas Becker CLA 2012-01-09 04:20:57 EST
Btw. I discussed with Simone that the test might be fragile as it's timing is pretty precise. A GC at the wrong time for example might make the test fail as the timeouts,etc. are pretty small.
However if we make them bigger the test will last longer. I suggest to leave it as is and if it fails on hudson, we should review. Do you agree?