[roll] Roll fuchsia [superproject] Roll third_party/pigweed pw_emu: mock_emu: start listening before making the port available

There is a race condition in mock_emu because we are making the port
available (writing it to a file for clients to read) before marking
the socket as listening.

If the client gets to run after the port is written to the file but
before the TCP thread has a chance to run we would get this error:

======================================================================
ERROR: test_channel_stream (__main__.TestEmulator)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "../../pw_emu/py/tests/frontend_test.py", line 116, in test_channel_stream
    with self._emu.get_channel_stream('gdb') as _:
  File "/b/s/w/ir/x/w/co/pw_emu/py/pw_emu/frontend.py", line 256, in get_channel_stream
    return self._c().get_channel_stream(name, timeout)
  File "/b/s/w/ir/x/w/co/pw_emu/py/pw_emu/core.py", line 533, in get_channel_stream
    sock.connect((host, port))
ConnectionRefusedError: [Errno 111] Connection refused

The fix is to mark the socket for listening before writing the port to
the file.

Original-Bug: 306155313
Test: stress --cpu 512 and run frontend_test.py 100 times without failures
Original-Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/176856
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Original-Revision: aba67f9a2a71cbcc7af1a1881b046a0a7bd7e0ca
GitOrigin-RevId: 57739f6c4a2f145d606768b1aaa0078c70602e40
Roller-URL: https://ci.chromium.org/b/8766871710982167281
CQ-Do-Not-Cancel-Tryjobs: true
Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/934192
Original-Revision: 09467f80aff903a784f608c259b24835da49f232
Change-Id: If60153dffde24fdb096e46f98643dfce73b596df
1 file changed
tree: 887ecc3353d58321f55d50b19ba0283f20c46223
  1. git-hooks/
  2. infra/
  3. third_party/
  4. cts
  5. firmware
  6. flower
  7. jiri.lock
  8. MILESTONE
  9. minimal
  10. prebuilts
  11. README.md
  12. stem
  13. test_durations
  14. toolchain
README.md

Integration

This repository contains Fuchsia's Global Integration manifest files.

Making changes

All changes should be made to the internal version of this repository. Our infrastructure automatically updates this version when the internal one changes.

Currently all changes must be made by a Google employee. Non-Google employees wishing to make a change can ask for assistance via the IRC channel #fuchsia on Freenode.

Obtaining the source

First install Jiri.

Next run:

$ jiri init
$ jiri import minimal https://fuchsia.googlesource.com/integration
$ jiri update

Third party

Third party projects should have their own subdirectory in ./third_party.