Rewrite and improve Variables service socket event related tests