forked from TrueCloudLab/frostfs-s3-gw
[#605] Fix panic when payload discard
Signed-off-by: Roman Loginov <r.loginov@yadro.com>
This commit is contained in:
parent
250538a9b4
commit
e7a8d4bdaf
3 changed files with 29 additions and 5 deletions
|
@ -49,3 +49,16 @@ func TestGoroutinesDontLeakInPutAndHash(t *testing.T) {
|
|||
require.ErrorIs(t, err, expErr)
|
||||
require.Empty(t, payload.Len(), "body must be read out otherwise goroutines can leak in wrapReader")
|
||||
}
|
||||
|
||||
func TestNilPayloadPutAndHash(t *testing.T) {
|
||||
tc := prepareContext(t)
|
||||
prm := frostfs.PrmObjectCreate{
|
||||
Filepath: tc.obj,
|
||||
Payload: nil,
|
||||
}
|
||||
|
||||
expErr := errors.New("some error")
|
||||
tc.testFrostFS.SetObjectPutError(tc.obj, expErr)
|
||||
_, err := tc.layer.objectPutAndHash(tc.ctx, prm, tc.bktInfo)
|
||||
require.ErrorIs(t, err, expErr)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue