zookeeper
zookeeper copied to clipboard
ZOOKEEPER-4511: Fix flaky test FileTxnSnapLogMetricsTest.testFileTxnSnapLogMetrics
This test writes txns to trigger snapshot and expects some txns remain in txn log. But snapshot taking is asynchronous, thus all txns could be written to snapshot. So in restarting, it is possible that no txns to load after snapshot restored. This will fail assertion.
This commit solves this by:
- Uses
ZKTestCase.waitFor
to wait for snapshot to be taken. - Logs more txns after snapshot paused(aka.
FileSnap.close
).
In addition, this commit adds assertions for metric SNAPSHOT_TIME
.
Author: Kezhu Wang [email protected]
Reviewers: Enrico Olivelli [email protected], Mate Szalay-Beko [email protected]
Closes #1852 from kezhuw/ZOOKEEPER-4511-FileTxnSnapLogMetricsTest-testFileTxnSnapLogMetrics
(cherry picked from commit b34e1716e8fa430690252288f2e15c38fe65f325)
@eolivelli @symat Seems that travis is not enabled for branch 3.6 ?
Seems that travis is not enabled for branch 3.6 ?
yeah, it looks the case... we should fix this. although I don't think it would block this PR.
3.6 is end of life.