Changeset - ee88c8c07111
default
0
4
0
tests: remove sleep hack to expire sql_cache_short
A number of tests sleep for 1.5 or 2 seconds to let the beaker cache
'sql_cache_short' expire. This cache is for example used for IP permissions;
tests changing such permissions need to make sure they take effect before
proceeding, especially when exiting from the test.
A much faster method is to effectively invalidating the caches.
Because it is difficult and fragile to only invalidate the relevant cache --
difficult to know exactly which cache needs to be invalidated, fragile
because the string indicating the cache line is not very nice and might
change in the future (in the case of IP permissions for the default user,
the cache is referred to with something like
"get_user_ips_default_Mapper|UserIpMap|users". This string changes when the
permissions are for a different user.
Clearing all caches shouldn't be a problem in a test context.
A number of tests sleep for 1.5 or 2 seconds to let the beaker cache
'sql_cache_short' expire. This cache is for example used for IP permissions;
tests changing such permissions need to make sure they take effect before
proceeding, especially when exiting from the test.
A much faster method is to effectively invalidating the caches.
Because it is difficult and fragile to only invalidate the relevant cache --
difficult to know exactly which cache needs to be invalidated, fragile
because the string indicating the cache line is not very nice and might
change in the future (in the case of IP permissions for the default user,
the cache is referred to with something like
"get_user_ips_default_Mapper|UserIpMap|users". This string changes when the
permissions are for a different user.
Clearing all caches shouldn't be a problem in a test context.
4 files changed with 23 insertions and 8 deletions:
0 comments (0 inline, 0 general)
0 comments (0 inline, 0 general)