tests: add sleep to catch reload timeout in clock_handler#1256
tests: add sleep to catch reload timeout in clock_handler#1256ibujna wants to merge 1 commit intomemcached:nextfrom
Conversation
The reload timeout in clock_handler() is set to 1 second. Add a sleep to reliably trigger the event timeout during tests.
|
I'm not clear on this one either. The watcher should be waiting for the log lines to come in. What is this fixing, exactly? |
|
The libevent call for the proxy reload functionality is configured in the clock_handler() Line 3907 in 4b9e619 On some systems (tested for example on macOS Tahoe), there is a situation where the reload waits for this 1-second libevent event, but in the meantime the test receives the log entry "ts=12212211 gid=1000 type=proxy_conf status=start" from the socket. At minimum, a 1-second sleep should be added here. Same as setup in clock_handler(). This happens randomly about for example once every ten runs. |
|
@ibujna what's the actual test output when it fails? I'm fairly sure I designed this test so that it just blocks until the 1 second timer clicks over, so I'm curious what log line you're getting that causes it to fail. IIRC there's at least one other test where it'll wait for a while looking for a specific log line (edit: while ignoring anything else), and this test probably just needs that code. |
|
@ibujna Poking for an update; would like to see the actual output of the test error so I can understand this better. I will also be fixing my macos CI and running it myself though... |
|
So finally reproduce it on M1 Mac OS Tahoe 26.3. I get this fail output ok 3 - succeeded to allocate 1024 ustats This is my patch to see string from proxy |
|
Can you use So it requires running both tests at the same time, but it's just the ustats one that fails in a weird way? |
|
The output doesn't make sense to me. I know that it can't fail unless it's getting a different log line, but your test output shows the correct log line. There's no way there's a timing delay issue here unless it results in the wrong log line being printed. I'll come back to this later. should just write a set of MemcachedTest.pm subs for dealing with watcher logs. In other places I have it in a loop looking for the correct log line for some amount of time, which would probably do it here. |
|
I don't think there's a timeout on reading the |
The reload timeout in clock_handler() is set to 1 second. Add a sleep to reliably trigger the event timeout during tests.