China considered going to war with Russia in Central Asia during the 1870s. The causus belli was a revolt in Xinjiang that was backed by Russia.
China, however knew it would lose and decided against it. A stupid leader could have made the opposite decision. Russia would have taken the region as a prize.