zookeeper icon indicating copy to clipboard operation
zookeeper copied to clipboard

ZOOKEEPER-4511: Fix flaky test FileTxnSnapLogMetricsTest.testFileTxnSnapLogMetrics

Open kezhuw opened this issue 2 years ago • 2 comments

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)

kezhuw avatar Jun 29 '22 15:06 kezhuw

@eolivelli @symat Seems that travis is not enabled for branch 3.6 ?

kezhuw avatar Jun 29 '22 15:06 kezhuw

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.

symat avatar Jul 11 '22 07:07 symat

3.6 is end of life.

kezhuw avatar Feb 15 '23 02:02 kezhuw