New issue
Advanced search Search tips

Issue 921852 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 18
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 2
Type: Bug



Sign in to add a comment

TCPSocketTest.IsConnected fails on iOS 11 device

Project Member Reported by eugene...@chromium.org, Jan 15

Issue description

[ RUN      ] TCPSocketTest.IsConnected
../../net/socket/tcp_socket_unittest.cc:642: Failure
Value of: connecting_socket.IsConnectedAndIdle()
  Actual: true
Expected: false
Stack trace:
0   net_unittests                       0x0000000104a37b88 base::debug::StackTrace::StackTrace() + 56
1   net_unittests                       0x0000000103ec4b04 StackTraceGetter::CurrentStackTrace(int, int) + 64
2   net_unittests                       0x0000000103ecd490 testing::internal::UnitTestImpl::CurrentOsStackTraceExceptTop(int) + 76
3   net_unittests                       0x0000000103eccf4c testing::internal::AssertHelper::operator=(testing::Message const&) const + 184
4   net_unittests                       0x0000000102aa19b0 net::(anonymous namespace)::TCPSocketTest_IsConnected_Test::TestBody() + 4416

[  FAILED  ] TCPSocketTest.IsConnected (26 ms)

 
Project Member

Comment 1 by bugdroid1@chromium.org, Jan 16

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9de3629c7bbf09c25fb45a256084845d58f589ea

commit 9de3629c7bbf09c25fb45a256084845d58f589ea
Author: Eugene But <eugenebut@google.com>
Date: Wed Jan 16 00:13:20 2019

Marked TCPSocketTest.IsConnected as flaky on iOS.

Bug:  921852 
Change-Id: If3962ff70e6be6ee0a96deb721b58db3b251d301
Reviewed-on: https://chromium-review.googlesource.com/c/1410390
Commit-Queue: Eugene But <eugenebut@chromium.org>
Reviewed-by: Eric Roman <eroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#622905}
[modify] https://crrev.com/9de3629c7bbf09c25fb45a256084845d58f589ea/net/socket/tcp_socket_unittest.cc

Comment 2 by sczs@google.com, Jan 16 (6 days ago)

Owner: linds...@chromium.org
Status: Assigned (was: Untriaged)
lindsayw@ could you PTAL and triage if necessary

Comment 3 by eugene...@chromium.org, Jan 16 (6 days ago)

Owner: ----
Status: Untriaged (was: Assigned)
I don't think that Lindsay is the right owner for this. Net team does own bug triage and we should let them triage this bug.

Comment 4 by zhongyi@chromium.org, Jan 17 (5 days ago)

Owner: w...@chromium.org
This is a new test added when wez@ fixed SocketPosix::IsConnected() pre-Connect() behaviour for Fuchsia.

wez@, can you take a look? Is the added test for fuchsia only? 

Comment 5 by zhongyi@chromium.org, Jan 17 (5 days ago)

Related chromium changeļ¼› https://chromium-review.googlesource.com/c/chromium/src/+/1407505 if that helps.

Comment 6 by w...@chromium.org, Jan 17 (5 days ago)

Cc: eugene...@chromium.org
Labels: M-73
Status: Started (was: Untriaged)
Re #4/#5: This is a cross-platform test that IsConnected() and IsConnectedAndIdle() have the correct behaviour on all of our platforms; while investigating issues with a test that incidentally used IsConnected() failing under Fuchsia, we realised that there was no existing test coverage of the APIs.

The test is failing at https://cs.chromium.org/chromium/src/net/socket/tcp_socket_unittest.cc?l=648 under iOS, which indicates that the TCPClientSocket is reporting the connection as "idle" (i.e. no data ready to read) when it should not be.

I'm not sure how the stack works on iOS, but perhaps the write to the "accept" end of the socket is not _immediately_ causing the "connecting" end to be readable, and so that 

Comment 7 by w...@chromium.org, Jan 17 (5 days ago)

... cause it to do the check before it's actually readable?
Project Member

Comment 8 by bugdroid1@chromium.org, Jan 18 (5 days ago)

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d174213df2f194c4abaf857a71b8f2d93d782922

commit d174213df2f194c4abaf857a71b8f2d93d782922
Author: Wez <wez@chromium.org>
Date: Fri Jan 18 02:50:46 2019

Ensure test socket is readable before IsConnectedAndIdle check.

The IsConnected test writes a byte to a loopback socket, to verify that
that it is then correctly treated as not "idle".

Since the test did not actually block until the underlying platform
socket was signalled as readable, the test was flaky.

Add a call to select() to wait for the write to cause the receive side
to be readable, before testing expectations.

Bug:  921852 
Change-Id: I424fc33e430f25846eb9505d134fe1ee893ce6e5
Reviewed-on: https://chromium-review.googlesource.com/c/1419577
Commit-Queue: Ryan Hamilton <rch@chromium.org>
Reviewed-by: Ryan Hamilton <rch@chromium.org>
Reviewed-by: Eugene But <eugenebut@chromium.org>
Auto-Submit: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#623972}
[modify] https://crrev.com/d174213df2f194c4abaf857a71b8f2d93d782922/net/socket/tcp_socket_unittest.cc

Comment 9 by w...@chromium.org, Jan 18 (5 days ago)

Status: Fixed (was: Started)
Tentatively closing this out - please re-open if you see evidence of continued flakiness.

Sign in to add a comment