policer: Add "bad" testcase #673

Merged
fyrchik merged 1 commit from acid-ant/frostfs-node:bugfix/656-add-test-notfound into master 2023-09-06 08:05:01 +00:00
Member

Close #656

Signed-off-by: Anton Nikiforov an.nikiforov@yadro.com

Close #656 Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
acid-ant requested review from storage-core-committers 2023-09-04 09:04:54 +00:00
acid-ant requested review from storage-core-developers 2023-09-04 09:05:05 +00:00
fyrchik approved these changes 2023-09-04 12:44:45 +00:00
@ -41,3 +32,1 @@
zap.Stringer("cid", idCnr),
zap.Stringer("oid", idObj),
zap.String("error", err.Error()))
errFromBuryFn := p.buryFn(ctx, addrWithType.Address)
Owner

Why did you rename the error?

Why did you rename the error?
Author
Member

To keep error from p.cnrSrc.Get(idCnr).

To keep error from `p.cnrSrc.Get(idCnr)`.
Owner

I don't understand -- it is not used in this branch.

I don't understand -- it is not used in this branch.
Author
Member

See your point, revert these changes.

See your point, revert these changes.
fyrchik marked this conversation as resolved
@ -247,2 +248,3 @@
p.processObject(context.Background(), addrWithType)
err := p.processObject(context.Background(), addrWithType)
require.Nil(t, err)
Owner

require.NoError?

`require.NoError`?
Author
Member

Updated.

Updated.
fyrchik marked this conversation as resolved
@ -257,0 +278,4 @@
}
err := p.processObject(context.Background(), addrWithType)
require.True(t, client.IsErrContainerNotFound(err))
Owner

Fine, but we still don't check whether buryFn was called this way -- we could easily call it and return an error.

Fine, but we still don't check whether `buryFn` was called this way -- we could easily call it and return an error.
Author
Member

Agree, I added a few lines to test buryFn.

Agree, I added a few lines to test `buryFn`.
fyrchik marked this conversation as resolved
acid-ant force-pushed bugfix/656-add-test-notfound from aedf932266 to 41cff79351 2023-09-04 14:22:42 +00:00 Compare
acid-ant force-pushed bugfix/656-add-test-notfound from 41cff79351 to a51519654f 2023-09-04 14:41:34 +00:00 Compare
aarifullin approved these changes 2023-09-04 15:55:11 +00:00
aarifullin left a comment
Member

Thanks!

Thanks!
fyrchik reviewed 2023-09-05 06:23:35 +00:00
@ -257,0 +296,4 @@
WithBuryFunc(buryFn),
)
require.ErrorIs(t, p.processObject(context.Background(), addrWithType), fromBury)
Owner

That is useful, but not what I meant (I believe we already test this in a neighbour test.
In the first test we check the error, but do not check whether buryFn was called. It could be called, we must ensure it was not.

That is useful, but not what I meant (I believe we already test this in a neighbour test. In the first test we check the error, but do not check whether `buryFn` was called. It _could_ be called, we must ensure it was not.
Author
Member

Gotcha, added buryFn in init, removed redundant test.

Gotcha, added `buryFn` in `init`, removed redundant test.
fyrchik marked this conversation as resolved
acid-ant force-pushed bugfix/656-add-test-notfound from a51519654f to e2dc220b60 2023-09-05 06:29:31 +00:00 Compare
acid-ant force-pushed bugfix/656-add-test-notfound from e2dc220b60 to 9f4effc74f 2023-09-05 06:43:07 +00:00 Compare
fyrchik approved these changes 2023-09-06 08:03:20 +00:00
fyrchik approved these changes 2023-09-06 08:04:10 +00:00
fyrchik merged commit 88d50e4c77 into master 2023-09-06 08:05:01 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#673
No description provided.