No description provided.
test: Use byte unit 'M' for -maxuploadtarget functional test #23648
pull dougEfresh wants to merge 1 commits into bitcoin:master from dougEfresh:test-byteunit-maxuploadtarget changing 1 files +1 −1-
dougEfresh commented at 11:19 AM on December 2, 2021: contributor
- DrahtBot added the label Tests on Dec 2, 2021
-
shaavan commented at 6:39 AM on December 8, 2021: contributor
I agree with the PR’s idea, but IMO this test would be redundant as the condition is being added. Because:
- The arguments provided through
maxuploadtargetare passed through theParseByUnitfunction in init.cpp. Reference: https://github.com/bitcoin/bitcoin/blob/099325a7594f8187f9067d5bff8390084cceb9dd/src/init.cpp#L1114 - And the exact condition (that this PR is introducing) has already been tested in
ParseByUnit’s tests. Reference: https://github.com/bitcoin/bitcoin/blob/099325a7594f8187f9067d5bff8390084cceb9dd/src/util/strencodings.cpp#L543-L545
So, though I agree with the idea, I think this PR is redundant.
- The arguments provided through
-
dougEfresh commented at 1:28 PM on December 8, 2021: contributor
So, though I agree with the idea, I think this PR is redundant.
Think of this as a sanity check. It may seem redundant now, but as time goes on and more code is added this may catch some edge case not known today. Lastly, the cost is about 1 second more of testing time.
-
MarcoFalke commented at 1:35 PM on December 8, 2021: member
The arg is used twice in the test, if you pass
Monce and not the other time, you get the same coverage at twice the speed? -
dougEfresh commented at 4:44 PM on December 8, 2021: contributor
The arg is used twice in the test, if you pass
Monce and not the other time, you get the same coverage at twice the speed?My main intent of this PR is to verify ParseByteUnits is call within init.cpp:
And that
1and1Mbehave the same (that the default byte unit isM).If
1Mis sufficient, I'm fine using just this. -
MarcoFalke commented at 4:47 PM on December 8, 2021: member
You can also pick one randomly on the random seed, to converge to the same test coverage at no runtime cost.
- dougEfresh force-pushed on Dec 8, 2021
- dougEfresh renamed this:
test: Add functional test for -maxuploadtarget with byte unit '1M'
test: Use '1M' for -maxuploadtarget feature functional test
on Dec 8, 2021 -
dougEfresh commented at 6:17 PM on December 8, 2021: contributor
I now see what you are saying. I changed it to to simply change
1to1M -
shaavan commented at 7:26 AM on December 9, 2021: contributor
Changes since my last review:
- Updated PR, so that now instead of checking for both ‘1’ and ‘1M’ the test now checks only for ‘1M’
I tried to wrap my head around this change, but I seemed to can’t understand one thing. How, by doing this change, are we able to check this condition:
that 1 and 1M behave the same (that the default byte unit is M). @dougEfresh. It would be pretty helpful to add the logic behind the recent changes done to this PR in the PR’s description. Thank you.
-
dougEfresh commented at 9:00 AM on December 9, 2021: contributor
that 1 and 1M behave the same (that the default byte unit is M).
You are correct, this isn't validating this condition. I think it makes more sense to put the byte unit on the
800:As you mentioned early there are enough unit tests to validate parsing and amounts...etc
By using
800MI validate byte units don't crash bitcoind, while leaving1would be validating that the default byte unit isMI think that's good enough, what you think?
-
shaavan commented at 8:17 AM on December 10, 2021: contributor
By using
800MI validate byte units don't crash bitcoind, while leaving1would be validating that the default byte unit isMThat sounds like a better idea. This would also make sure using the
Msuffix is working correctly, along with other advantages you mentioned. So if I am correct, the ultimate patch would look something like this:diff: master..PR
self.extra_args = [[ - "-maxuploadtarget=800", + "-maxuploadtarget=800M", "-acceptnonstdtxn=1", ]] -
test: Use byte unit 'M' for -maxuploadtarget functional test 41b9f7d062
- dougEfresh force-pushed on Dec 10, 2021
- dougEfresh renamed this:
test: Use '1M' for -maxuploadtarget feature functional test
test: Use byte unit 'M' for -maxuploadtarget functional test
on Dec 10, 2021 -
dougEfresh commented at 6:44 PM on December 10, 2021: contributor
@shaavan correct.
41b9f7d062a01cf39b6dba02703213ffb1951a37 reflects this change
- shaavan approved
-
shaavan commented at 8:01 AM on December 11, 2021: contributor
ACK 41b9f7d062a01cf39b6dba02703213ffb1951a37
-
stratospher commented at 3:01 PM on December 13, 2021: contributor
ACK 41b9f7d.
- MarcoFalke merged this on Dec 13, 2021
- MarcoFalke closed this on Dec 13, 2021
- sidhujag referenced this in commit 105451effe on Dec 13, 2021
- DrahtBot locked this on Dec 13, 2022