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

Commite879526

Browse files
fix: resolveTestAPI/Error/DuringInjection flake (#19407)
Resolvescoder/internal#905
1 parentc7cfa65 commite879526

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

‎agent/agentcontainers/api_test.go‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2096,9 +2096,6 @@ func TestAPI(t *testing.T) {
20962096
}
20972097
)
20982098

2099-
coderBin,err:=os.Executable()
2100-
require.NoError(t,err)
2101-
21022099
// Mock the `List` function to always return the test container.
21032100
mCCLI.EXPECT().List(gomock.Any()).Return(codersdk.WorkspaceAgentListContainersResponse{
21042101
Containers: []codersdk.WorkspaceAgentContainer{testContainer},
@@ -2139,7 +2136,7 @@ func TestAPI(t *testing.T) {
21392136
require.Equal(t,http.StatusOK,rec.Code)
21402137

21412138
varresponse codersdk.WorkspaceAgentListContainersResponse
2142-
err=json.NewDecoder(rec.Body).Decode(&response)
2139+
err:=json.NewDecoder(rec.Body).Decode(&response)
21432140
require.NoError(t,err)
21442141

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

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

2160-
_,aw:=mClock.AdvanceNext()
2161-
aw.MustWait(ctx)
2157+
err=api.RefreshContainers(ctx)
2158+
require.NoError(t,err)
21622159

21632160
req=httptest.NewRequest(http.MethodGet,"/",nil)
21642161
rec=httptest.NewRecorder()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp