]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] unit test checks upstream rate limit state using a custom fake_clock 6100/head
authorDuncan Bellamy <dunk@denkimushi.com>
Thu, 11 Jun 2026 18:37:18 +0000 (19:37 +0100)
committerDuncan Bellamy <dunk@denkimushi.com>
Thu, 11 Jun 2026 18:37:18 +0000 (19:37 +0100)
under a mock environment where the event loop (ev_run()) is never actually executed.

test/rspamd_test_fake_time.hxx

index 2aa7704528e5f1f6d39e8229b18a7d341acec6b8..627849314a7f45c1604a017586a09da5d9597b37 100644 (file)
@@ -70,11 +70,17 @@ public:
                        seconds = 0.0;
                }
                now_ += seconds;
+               if (loop_) {
+                       ev_now_resync(loop_);
+               }
        }
 
        void set(double t)
        {
                now_ = t;
+               if (loop_) {
+                       ev_now_resync(loop_);
+               }
        }
 
        double now() const