• Binbin's avatar
    Fix dict resize allow test (#13016) · 9a7d3118
    Binbin authored
    Ci report this failure:
    ```
    *** [err]: Don't rehash if used memory exceeds maxmemory after rehash in tests/unit/maxmemory.tcl
    Expected '4098' to equal or match '4002'
    
    WARNING: the new maxmemory value set via CONFIG SET (1176088) is smaller than the current memory usage (1231083)
    ```
    
    It can be seen from the log that used_memory changed before we set
    maxmemory.
    The reason is that in #12819, in cron, in addition to trying to shrink,
    we will
    also tyring to expand. The dict was expanded by cron before we set
    maxmemory,
    causing the test to fail.
    
    Before setting maxmemory, we only add 4095 keys to avoid triggering
    resize.
    9a7d3118
maxmemory.tcl 21.1 KB