You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, creating 200 dummy changeset comments can take a few seconds. It would be a nice-to-have to allow this value to be overridden, and a lower (faster) value to be used in the test suite. Reducing the value from 200 to 20 reduces that test from 5.6 to 1.6 seconds on my machine.
It's also a good idea to avoid magic numbers in the code anyway. It took me a while to figure that the number in the test suite was a specific number, and not just "some arbitrary large number".
The text was updated successfully, but these errors were encountered:
In the calculation for the changeset_comments rate limit, there is a hardcoded value of "200" for deciding if a user is experienced or not.
openstreetmap-website/app/models/user.rb
Line 414 in b09fc83
This has to be matched by the same hardcoded value in the tests
openstreetmap-website/test/controllers/api/changeset_comments_controller_test.rb
Line 161 in b09fc83
However, creating 200 dummy changeset comments can take a few seconds. It would be a nice-to-have to allow this value to be overridden, and a lower (faster) value to be used in the test suite. Reducing the value from 200 to 20 reduces that test from 5.6 to 1.6 seconds on my machine.
It's also a good idea to avoid magic numbers in the code anyway. It took me a while to figure that the number in the test suite was a specific number, and not just "some arbitrary large number".
The text was updated successfully, but these errors were encountered: