Commit e3bfefb1 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
Change-Id: I54b5de9527d9737e6c987b6a9c4f62578f4f8fb7
parent 8bced3e7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment