Bug in SizeInBytesSafe function #542

Closed
opened 2023-07-26 14:00:34 +00:00 by dstepanov-yadro · 0 comments

There is a bug with strings like Xb or XB, where X - one digit

Steps to Reproduce (for bugs)

  1. File cmd/frostfs-node/config/test/config.yaml, add
sizes:
	...
    size_one_byte: 1b
  1. File cmd/frostfs-node/config/test/config.json, add
  "sizes": {
...
    "size_one_byte": "1b"
},
  1. File cmd/frostfs-node/config/cast_test.go add test case:
require.EqualValues(t, 1, config.SizeInBytesSafe(c, "size_one_byte"))

Context

SizeInBytesSafe from cmd/frostfs-node/config/cast.go

There is a bug with strings like `Xb` or `XB`, where X - one digit ## Steps to Reproduce (for bugs) 1. File `cmd/frostfs-node/config/test/config.yaml`, add ``` sizes: ... size_one_byte: 1b ``` 2. File `cmd/frostfs-node/config/test/config.json`, add ``` "sizes": { ... "size_one_byte": "1b" }, ``` 3. File `cmd/frostfs-node/config/cast_test.go` add test case: ``` require.EqualValues(t, 1, config.SizeInBytesSafe(c, "size_one_byte")) ``` ## Context `SizeInBytesSafe` from cmd/frostfs-node/config/cast.go
dstepanov-yadro added the
bug
good first issue
triage
labels 2023-07-26 14:00:34 +00:00
fyrchik added
P3
help wanted
and removed
triage
labels 2023-07-27 17:01:55 +00:00
fyrchik added this to the v0.37.0 milestone 2023-07-27 17:02:14 +00:00
acid-ant was assigned by fyrchik 2023-07-31 12:47:38 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 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#542
There is no content yet.