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

Bug 352991

Summary: HttpExchangeTest running too long
Product: [RT] Jetty Reporter: Thomas Becker <tbecker>
Component: clientAssignee: Thomas Becker <tbecker>
Status: CLOSED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3 CC: jetty-inbox, mgorovoy
Version: 7.4.2   
Target Milestone: 7.5.x   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
proposed patch
none
proposed patch - VERSION.txt fix none

Description Thomas Becker CLA 2011-07-25 07:10:02 EDT
Build Identifier: 

HttpExchangeTest is running longer than necessary.

The patch I will provide reduces runtime of the Unit Tests from about 15s to 2.5s on my MacBook.

Main changes:
- only start/stop the server once per class instead of per test
- Same for the client with one exception (testReserveConnections).
- don't sleep for 500ms until the client is stopped, instead wait for client state to change to STOPPED

Patch attached.


Reproducible: Always
Comment 1 Thomas Becker CLA 2011-07-25 07:57:13 EDT
Created attachment 200272 [details]
proposed patch
Comment 2 Thomas Becker CLA 2011-07-25 08:02:22 EDT
Be aware that with the proposed patch each test is not anymore getting a fresh server and httpClient. From the code it looks fine (except testReserveConnections), so I reused the same instances of server and client.
Comment 3 Thomas Becker CLA 2011-07-25 09:03:11 EDT
Created attachment 200277 [details]
proposed patch - VERSION.txt fix
Comment 4 Michael Gorovoy CLA 2011-07-25 10:23:16 EDT
Re-assigning to Thomas.
Comment 5 Michael Gorovoy CLA 2011-07-25 10:26:15 EDT
One suggestion I would like to make is that it is better not to reformat existing code unless absolutely necessary, otherwise the important changes are buried in a flood of spaces-only diffs.
Comment 6 Thomas Becker CLA 2011-07-25 10:27:50 EDT
I will split the code format into a second patch next time. The code is formatted using the jetty code templates, but should have been done in an individual patch so one can identify the "real" changes immediately.
Comment 7 Thomas Becker CLA 2011-07-28 11:24:42 EDT
Don't commit this, until I finished the subclasses of this test!
Comment 8 Thomas Becker CLA 2011-08-01 11:39:23 EDT

*** This bug has been marked as a duplicate of bug 353509 ***