fix pusher concurrent close channel

Signed-off-by: rongfu.leng <rongfu.leng@daocloud.io>
This commit is contained in:
rongfu.leng
2022-10-04 22:11:15 +08:00
committed by rongfu.leng
parent 8abee9c8bb
commit 63a7d8a7ff
2 changed files with 11 additions and 14 deletions

View File

@@ -293,7 +293,7 @@ func Test_dockerPusher_push(t *testing.T) {
dp dockerPusher
dockerBaseObject string
args args
checkerFunc func(writer pushWriter) bool
checkerFunc func(writer *pushWriter) bool
wantErr error
}{
{
@@ -306,7 +306,7 @@ func Test_dockerPusher_push(t *testing.T) {
ref: fmt.Sprintf("manifest-%s", manifestContentDigest.String()),
unavailableOnFail: false,
},
checkerFunc: func(writer pushWriter) bool {
checkerFunc: func(writer *pushWriter) bool {
select {
case resp := <-writer.respC:
// 201 should be the response code when uploading a new manifest
@@ -340,7 +340,7 @@ func Test_dockerPusher_push(t *testing.T) {
ref: fmt.Sprintf("layer-%s", layerContentDigest.String()),
unavailableOnFail: false,
},
checkerFunc: func(writer pushWriter) bool {
checkerFunc: func(writer *pushWriter) bool {
select {
case resp := <-writer.respC:
// 201 should be the response code when uploading a new blob
@@ -379,7 +379,7 @@ func Test_dockerPusher_push(t *testing.T) {
}
// test whether a proper response has been received after the push operation
assert.True(t, test.checkerFunc(*pw))
assert.True(t, test.checkerFunc(pw))
})
}