Skip to content

Dev agent: protocol tests on ubuntu and windows; two defects they found (#238) - #248

Merged
b-re-w merged 3 commits into
developfrom
feat/devagent-ci
Oct 17, 2026
Merged

b-re-w merged 3 commits into
developfrom
feat/devagent-ci

Conversation

@b-re-w

@b-re-w b-re-w commented Oct 17, 2026

Copy link
Copy Markdown
Member

Closes #238

Option (b): a light, stdlib-only job (dev-agent in desktop.yml, develop pushes, setup-python and no JDK). It runs test_devagent on ubuntu-latest and windows-latest.

Defects fixed (found by the first ubuntu and windows runs)

  • Windows: push wrote outside the overlay.
    • "/abs/escape.py" was accepted, because on Windows os.path.isabs is False for a rooted path without a drive (Python 3.13+), and the join landed on the drive root.
    • Paths now follow the protocol's own rule: relative and /-separated, with no backslash, colon, or empty/./.. segment, and the result must resolve inside the overlay.
  • Linux: stop() did not free the port.
    • close() left a listener that a thread was blocked accepting on in LISTEN, so a restarted agent got EADDRINUSE.
    • stop() now calls shutdown() on the listener first and joins the accept and connection threads.
  • Test bug: the takeover test evaluated socket.SO_REUSEPORT where it does not exist (Windows).

Test added

  • The path test now covers the Windows forms on every OS: C:/…, C:…, \…, a\..\..\…, //server/share/…, ./a.py, a//b.py, and the empty path. It was red on macOS before the fix.

Verification

  • One-off probe on the throwaway branch feat/devagent-ci-probe (deleted after the run):
    • Run 39032457150 (before the fixes) failed as described above.
    • Run 39032959598 (after): ubuntu passed, windows passed, and windows with SO_EXCLUSIVEADDRUSE removed failed in test_another_socket_cannot_take_the_port_over ("OSError not raised : option 4", i.e. SO_REUSEADDR took the port).
  • Local (macOS): Python 23 OK; PythonDevAgentTest 4/4.

Documentation corrected

  • SPEC L-12 now states the push path rule and where the tests run, and records toolchain#105.

A stdlib-only job (setup-python, no JDK or Gradle) on develop pushes. The
socket options differ per platform, and the port-takeover and restart tests
are what check them.
… Linux (#238)

Found by the first ubuntu and windows runs:

- push accepted "/abs/escape.py" on Windows, where os.path.isabs is False
  for a rooted path without a drive (Python 3.13+) and the join lands on the
  drive root. Paths now follow the protocol's own rule (relative,
  /-separated, no backslash, colon, empty, . or .. segment) and must resolve
  inside the overlay; the test covers the Windows forms on every OS.
- On Linux, close() left a listener that a thread was blocked accepting on
  in LISTEN, so a restarted agent got EADDRINUSE. stop() now shuts the
  listener down first and joins the accept and connection threads.
- The port-takeover test evaluated socket.SO_REUSEPORT where it does not
  exist (Windows).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant