Commit 80dc43a9 authored by Neil Fuller's avatar Neil Fuller
Browse files

Fix OkHttp test failure for fast devices

On a fast device the ThreadInterruptTest#interruptWritingRequestBody
would consistently fail.

The issue is probably a combination of socket buffering and the data
volume chosen by the test. The test was written to assume that
read-side throttling would prevent the writer from writing its data
within 500 millis. After ~500 millis the write thread would be
interrupted and the test would pass.

On a fast device the test would write all the test data
in ~ 125 millis and the test would fail. The interruption would then
trigger on a later test
(typically URLConnectionTest#authenticateWithGetAndTransparentGzip),
breaking that test as well.

If there is sufficient socket-level read/write buffering it is
possible the data being written will just fill the socket buffers
and the writer will terminate early. If the data to be written is
increased from 2 to 10 MB the test passes.

Bug: 17516838
(cherry-picked from commit e3bfefb1)

Change-Id: Id832c366611d19a0e771b5dfb58a716b17221f95
parent 2ef5d26d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment