• Binbin's avatar
    Fix timing issue in slowlog redact test (#10614) · a6b3ce28
    Binbin authored
    * Fix timing issue in slowlog redact test
    
    This test failed once in my daily CI (test-sanitizer-address (clang))
    ```
    *** [err]: SLOWLOG - Some commands can redact sensitive fields in tests/unit/slowlog.tcl
    Expected 'migrate 127.0.0.1 25649 key 9 5000 AUTH2 (redacted) (redacted)' to match '* key 9 5000 AUTH (redacted)' (context: type eval line 12 cmd {assert_match {* key 9 5000 AUTH (redacted)} [lindex [lindex [r slowlog get] 1] 3]} proc ::test)
    ```
    
    The reason is that with slowlog-log-slower-than 10000,
    slowlog get will have a chance to exceed 10ms.
    
    Change slowlog-log-slower-than from 10000 to -1, disable it.
    Also handles a same potentially problematic test above.
    This is actually the same timing issue as #10432.
    
    But also avoid repeated calls to `SLOWLOG GET`
    a6b3ce28
slowlog.tcl 7.4 KB