Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352991 - HttpExchangeTest running too long
Summary: HttpExchangeTest running too long
Status: CLOSED DUPLICATE of bug 353509
Alias: None
Product: Jetty
Classification: RT
Component: client (show other bugs)
Version: 7.4.2   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: 7.5.x   Edit
Assignee: Thomas Becker CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-25 07:10 EDT by Thomas Becker CLA
Modified: 2011-08-01 11:39 EDT (History)
2 users (show)

See Also:


Attachments
proposed patch (29.23 KB, patch)
2011-07-25 07:57 EDT, Thomas Becker CLA
no flags Details | Diff
proposed patch - VERSION.txt fix (29.30 KB, patch)
2011-07-25 09:03 EDT, 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 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 ***