@@ -2096,9 +2096,6 @@ func TestAPI(t *testing.T) {
2096
2096
}
2097
2097
)
2098
2098
2099
- coderBin ,err := os .Executable ()
2100
- require .NoError (t ,err )
2101
-
2102
2099
// Mock the `List` function to always return the test container.
2103
2100
mCCLI .EXPECT ().List (gomock .Any ()).Return (codersdk.WorkspaceAgentListContainersResponse {
2104
2101
Containers : []codersdk.WorkspaceAgentContainer {testContainer },
@@ -2139,7 +2136,7 @@ func TestAPI(t *testing.T) {
2139
2136
require .Equal (t ,http .StatusOK ,rec .Code )
2140
2137
2141
2138
var response codersdk.WorkspaceAgentListContainersResponse
2142
- err = json .NewDecoder (rec .Body ).Decode (& response )
2139
+ err : =json .NewDecoder (rec .Body ).Decode (& response )
2143
2140
require .NoError (t ,err )
2144
2141
2145
2142
// Then: We expect that there will be an error associated with the devcontainer.
@@ -2149,16 +2146,16 @@ func TestAPI(t *testing.T) {
2149
2146
gomock .InOrder (
2150
2147
mCCLI .EXPECT ().DetectArchitecture (gomock .Any (),testContainer .ID ).Return (runtime .GOARCH ,nil ),
2151
2148
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 ),
2153
2150
mCCLI .EXPECT ().ExecAs (gomock .Any (),testContainer .ID ,"root" ,"chmod" ,"0755" ,"/.coder-agent" ,"/.coder-agent/coder" ).Return (nil ,nil ),
2154
2151
mCCLI .EXPECT ().ExecAs (gomock .Any (),testContainer .ID ,"root" ,"/bin/sh" ,"-c" ,"chown $(id -u):$(id -g) /.coder-agent/coder" ).Return (nil ,nil ),
2155
2152
)
2156
2153
2157
2154
// Given: We allow creation to succeed.
2158
2155
testutil .RequireSend (ctx ,t ,fSAC .createErrC ,nil )
2159
2156
2160
- _ , aw := mClock . AdvanceNext ( )
2161
- aw . MustWait ( ctx )
2157
+ err = api . RefreshContainers ( ctx )
2158
+ require . NoError ( t , err )
2162
2159
2163
2160
req = httptest .NewRequest (http .MethodGet ,"/" ,nil )
2164
2161
rec = httptest .NewRecorder ()