Skip to content

flake: TestAgentScript/Invalid #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sreya opened this issue Oct 5, 2024 · 0 comments · Fixed by coder/coder#15142
Closed

flake: TestAgentScript/Invalid #93

sreya opened this issue Oct 5, 2024 · 0 comments · Fixed by coder/coder#15142
Assignees
Labels

Comments

@sreya
Copy link

sreya commented Oct 5, 2024

Seen here

=== Failed
=== FAIL: provisionersdk TestAgentScript/Invalid (10.02s)
    agent_test.go:126: 
        	Error Trace:	/home/runner/work/coder/coder/provisionersdk/agent_test.go:126
        	Error:      	Received unexpected error:
        	            	os: process already finished
        	Test:       	TestAgentScript/Invalid

=== FAIL: provisionersdk TestAgentScript (0.00s)

And here

=== Failed
=== FAIL: provisionersdk TestAgentScript/Invalid (10.01s)
    agent_test.go:128: unable to cancel the command, see logs:
        + trap waitonexit EXIT
        + mktemp -d -t coder.XXXXXX
        + BINARY_DIR=/tmp/coder.kHVqDU
        + BINARY_NAME=coder
        + BINARY_URL=http://127.0.0.1:32787/bin/coder-linux-amd64
        + cd /tmp/coder.kHVqDU
        + :
        + status=
        + command -v curl
        + curl -fsSL --compressed http://127.0.0.1:32787/bin/coder-linux-amd64 -o coder
        + break
        + chmod +x coder
        + [ -n  ]
        + export CODER_AGENT_AUTH=token
        + export CODER_AGENT_URL=http://127.0.0.1:32787/
        + ./coder --version
        + head -n1
        + output=this is not the agent you are looking for
        + grep -q Coder
        + echo this is not the agent you are looking for
        + echo ERROR: Downloaded agent binary returned unexpected version output
        ERROR: Downloaded agent binary returned unexpected version output
        + echo coder --version output: "this is not the agent you are looking for"
        coder --version output: "this is not the agent you are looking for"
        + exit 2
        + waitonexit
        + echo === Agent script exited with non-zero code (2). Sleeping 24h to preserve logs...
        === Agent script exited with non-zero code (2). Sleeping 24h to preserve logs...
        + sleep 86400
    testing.go:1398: race detected during execution of test
@matifali matifali removed the tests label Oct 16, 2024
@dannykopping dannykopping self-assigned this Oct 18, 2024
ethanndickson pushed a commit to coder/coder that referenced this issue Oct 21, 2024
Fixes coder/internal#93

`bytes.Buffer` is not concurrency-safe.

`cmd` could write to the buffer concurrently while we're reading the
buffer in

```
require.Eventually(t, func() bool {
	return bytes.Contains(output.Bytes(), []byte("ERROR: Downloaded agent binary returned unexpected version output"))
}, testutil.WaitShort, testutil.IntervalSlow)
```

Not sure about the `os: process already finished` flake, though.

---------

Signed-off-by: Danny Kopping <danny@coder.com>
defelmnq pushed a commit to coder/coder that referenced this issue Oct 23, 2024
Fixes coder/internal#93

`bytes.Buffer` is not concurrency-safe.

`cmd` could write to the buffer concurrently while we're reading the
buffer in

```
require.Eventually(t, func() bool {
	return bytes.Contains(output.Bytes(), []byte("ERROR: Downloaded agent binary returned unexpected version output"))
}, testutil.WaitShort, testutil.IntervalSlow)
```

Not sure about the `os: process already finished` flake, though.

---------

Signed-off-by: Danny Kopping <danny@coder.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants