Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Tests using Cobra withptytest can hang on macOS (and Windows) unless the output is consumed #2122

Closed
Labels
apiArea: HTTP APIsiteArea: frontend dashboard
@mafredri

Description

@mafredri

Unlessptytest output is consumed, a test can hang if a command outputs more than1024 bytes (at least on macOS).

There are two ways to work around this issue:

  1. Consume the output viapty.ExpectMatch() (ensure no more than 1024 bytes are left unread)
  2. Usecmd.SetOut(io.Discard) instead

Since usingptytest is a common pattern in our tests, it'd be a good idea to rewrite it so that a hang is not possible.

Unless there's a bug to be fixed in underlying libraries, or changes to how ptys are configured, the most robust way to fix this would be forptytest to buffer/consumeall command output, irregardless of a call toExpectMatch.

A reproduction of this bug exists as a test in#1629 (and will be merged in and skipped on macOS and Windows).

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiArea: HTTP APIsiteArea: frontend dashboard

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp