Let $S_n$ be a random walk and $\tau$ be a stopping time. Let $\tau$ be a stopping time for the random walk and define $\tau_N := \min \{ \tau, N \}$, which is a bounded stopping time. Assume that I know that $S^2_{\tau_N}$ converges to $S^2_{\tau}$ with $N$ almost surely.
Why is this not enough to conclude that $E[S^2_{\tau_N}] \rightarrow E[S^2_\tau]$, just by considering that almost sure convergence implies $L_2$-convergence? The book that I am reading justifies this fact by using a different argument, which is based on showing that $E[S^2_{\tau_N}]$ constitutes a Cauchy sequence.
In fact, almost sure convergence does not imply $L^2$-convergence in general: Consider for example $f_n(x) = n1_{\{0\le x\le 1/n^2\}}$. This sequence clearly converges Lebesgue-almost surely to $0$ but the second moments $\mathbb E[f_n^2] = 1$ do not converge to $0$. Hence, $(f_n)_{n\in\mathbb N}$ cannot converge in $L^2$.