Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367974 - ConnectorTimeoutTest and subclasses use fixed maxIdleTime
Summary: ConnectorTimeoutTest and subclasses use fixed maxIdleTime
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: 7.5.x   Edit
Assignee: Thomas Becker CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-05 14:13 EST by Thomas Becker CLA
Modified: 2012-01-09 04:20 EST (History)
1 user (show)

See Also:


Attachments
proposed patch (4.91 KB, patch)
2012-01-06 08:10 EST, Thomas Becker CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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?