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
The Zonemaster::Engine::ASNLookup module has two global variables @db_sources and $db_style. These get computed once based on profile properties, but they are never reset. These global values should either be reset between test runs, or they shouldn't be global variables at all.
While these variables are publicly accessible to and could technically be reset from calling code, this requirement is not documented, it's not implemented in Backend, and it's rather bad API design. It would be better to add a class method called reset or something to the Zonemaster::Engine::ASNLookup module. This reset method should probably be called automatically from Zonemaster::Engine->reset() or perhaps Zonemaster::Engine::Test->{run_for_all,run_module,run_one}().
But really, from a quick look at the code I believe we should be able to recompute these values anew every time we need them and do away with the caching altogether.
The text was updated successfully, but these errors were encountered:
The
Zonemaster::Engine::ASNLookup
module has two global variables@db_sources
and$db_style
. These get computed once based on profile properties, but they are never reset. These global values should either be reset between test runs, or they shouldn't be global variables at all.While these variables are publicly accessible to and could technically be reset from calling code, this requirement is not documented, it's not implemented in Backend, and it's rather bad API design. It would be better to add a class method called
reset
or something to theZonemaster::Engine::ASNLookup
module. This reset method should probably be called automatically fromZonemaster::Engine->reset()
or perhapsZonemaster::Engine::Test->{run_for_all,run_module,run_one}()
.But really, from a quick look at the code I believe we should be able to recompute these values anew every time we need them and do away with the caching altogether.
The text was updated successfully, but these errors were encountered: