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

fix: resolveTestAPI/Error/DuringInjection flake#19407

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
DanielleMaywood merged 1 commit intomainfromdanielle/flake/during-injection
Aug 19, 2025
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletionsagent/agentcontainers/api_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2096,9 +2096,6 @@ func TestAPI(t *testing.T) {
}
)

coderBin, err := os.Executable()
require.NoError(t, err)
Comment on lines -2099 to -2100
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It looks like this might sometimes be a symlink which we aren't resolving which causes a problem in the tests on nightly gauntlet. Instead of resolving this symlink, I've just removed this and replaced the mock expectation withgomock.Any() as we don't really care about this for this test.


// Mock the `List` function to always return the test container.
mCCLI.EXPECT().List(gomock.Any()).Return(codersdk.WorkspaceAgentListContainersResponse{
Containers: []codersdk.WorkspaceAgentContainer{testContainer},
Expand DownExpand Up@@ -2139,7 +2136,7 @@ func TestAPI(t *testing.T) {
require.Equal(t, http.StatusOK, rec.Code)

var response codersdk.WorkspaceAgentListContainersResponse
err = json.NewDecoder(rec.Body).Decode(&response)
err:= json.NewDecoder(rec.Body).Decode(&response)
require.NoError(t, err)

// Then: We expect that there will be an error associated with the devcontainer.
Expand All@@ -2149,16 +2146,16 @@ func TestAPI(t *testing.T) {
gomock.InOrder(
mCCLI.EXPECT().DetectArchitecture(gomock.Any(), testContainer.ID).Return(runtime.GOARCH, nil),
mCCLI.EXPECT().ExecAs(gomock.Any(), testContainer.ID, "root", "mkdir", "-p", "/.coder-agent").Return(nil, nil),
mCCLI.EXPECT().Copy(gomock.Any(), testContainer.ID,coderBin, "/.coder-agent/coder").Return(nil),
mCCLI.EXPECT().Copy(gomock.Any(), testContainer.ID,gomock.Any(), "/.coder-agent/coder").Return(nil),
mCCLI.EXPECT().ExecAs(gomock.Any(), testContainer.ID, "root", "chmod", "0755", "/.coder-agent", "/.coder-agent/coder").Return(nil, nil),
mCCLI.EXPECT().ExecAs(gomock.Any(), testContainer.ID, "root", "/bin/sh", "-c", "chown $(id -u):$(id -g) /.coder-agent/coder").Return(nil, nil),
)

// Given: We allow creation to succeed.
testutil.RequireSend(ctx, t, fSAC.createErrC, nil)

_, aw := mClock.AdvanceNext()
aw.MustWait(ctx)
err = api.RefreshContainers(ctx)
require.NoError(t, err)
Comment on lines +2157 to +2158
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

drive by fix: whilst trying to recreate this flake, i got this to fail because the clock would skip a turn for some reason, so instead we just invokeRefreshContainers directly.

mafredri reacted with thumbs up emoji

req = httptest.NewRequest(http.MethodGet, "/", nil)
rec = httptest.NewRecorder()
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp