1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-14 11:58:02 +00:00

fix(test): Fix flaky test (#2372)

Issue was that in `ServerFamilyTest.SlowLogLen` we set the threshold to
be 0 microseconds and make sure that all commands are logged as slow.
However, in opt, some commands sometimes take 0 microseconds, which
fails the test.

Confirmed via:

```
./server_family_test --gtest_repeat=100 --gtest_filter=ServerFamilyTest.SlowLogLen
```
This commit is contained in:
Shahar Mike 2024-01-04 13:23:17 +02:00 committed by GitHub
parent 0e72846457
commit b15109d4d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1228,7 +1228,7 @@ bool Service::InvokeCmd(const CommandId* cid, CmdArgList tail_args, ConnectionCo
// not just the blocking ones
const auto* conn = cntx->conn();
if (!(cid->opt_mask() & CO::BLOCKING) && conn != nullptr && etl.GetSlowLog().IsEnabled() &&
invoke_time_usec > etl.log_slower_than_usec) {
invoke_time_usec >= etl.log_slower_than_usec) {
vector<string> aux_params;
CmdArgVec aux_slices;