public boolean commitAndPublishTransaction(@NotNull Database db,
                                               long transactionId,
                                               @NotNull List<TabletCommitInfo> tabletCommitInfos,
                                               @NotNull List<TabletFailInfo> tabletFailInfos,
                                               long timeoutMillis) throws UserException {
        try {
            return commitAndPublishTransaction(db, transactionId, tabletCommitInfos, tabletFailInfos, timeoutMillis, null);
        } catch (LockTimeoutException e) {
            throw ErrorReportException.report(ErrorCode.ERR_LOCK_ERROR, e.getMessage());
        }
    }
@Test
    public void testCommitLockTimeout() throws UserException, LockTimeoutException {
        Database db = new Database(10L, "db0");
        GlobalTransactionMgr globalTransactionMgr = spy(new GlobalTransactionMgr(GlobalStateMgr.getCurrentState()));
        doThrow(LockTimeoutException.class)
                .when(globalTransactionMgr)
                .commitAndPublishTransaction(db, 1001L, Collections.emptyList(), Collections.emptyList(), 10L, null);
        Assert.assertThrows(ErrorReportException.class, () -> globalTransactionMgr.commitAndPublishTransaction(db, 1001L,
                Collections.emptyList(), Collections.emptyList(), 10L));
    }