buildkite / buildkite/agent

Build slowness caused by TTY escape sequences

Open
#1,147 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.1k
Forks
378
Avg merge
2d 6h
Merged PRs (30d)
74

Description

My studio uses C#/DotNet on our Buildkite server and discovered that dotnet, likely because of its provenances as a Windows-based product, does not detect that it is talking to a pipe, not a TTY, and consequently writes TTY-escape sequences while running `dotnet test` with the XUnit testing framework (perhaps also with the Microsoft test framework too; I haven't check that).

Apparently the software that Buildkite uses to read from programs (perhaps https://github.com/buildkite/terminal-to-html?) runs slowly when receiving these escape sequences.

````
# 21 second run-time
dotnet test --no-build Foo

# 5 second run-time by stripping all but \t\r\n
dotnet test --no-build Foo | tr -d '\000-\010\013\014\016-\037'
````

We've been able to overcome this problem with the above hack, but perhaps it's something you should look into?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the `dotnet test --no-build Foo` run through Buildkite and compare it with the output filtered by `tr -d '\000-\010\013\014\016-\037'`. Done means identifying whether the agent or its terminal-output handling causes the slowdown and documenting or implementing a fix that avoids the performance impact of these escape sequences.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
ci-cd, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.