When asked to name former and existing communist nations, the USSR and China jump to mind. And the ideological battle behind the Cold War was, fundamentally, capitalism vs. communism. But that might provide a united image unfitting of the relationship between the top Cold War communist powers. The relationship has been much more up and down.
In 1937, when World War II broke out on the Asian front, the USSR and China formed a non-aggression pact. China had been undergoing a civil war between the Nationalists and the Communists, though the fighting postponed once Japan invaded Manchuria. Throughout China's civil war, the USA had been funding the Nationalists while the USSR funded the Communists. In 1949, the Communists took control of the country. China and the USSR now had the "Sino-Soviet Treaty of Friendship, Alliance and Mutual Assistance." Reportedly, Stalin did not like Mao when the two met, but the leader's less-than-friendly relationship did not appear to interfere with international relations.
The two nations held a close relationship through shared ideology as well as mutual benefits- the USSR had continued control of naval bases such as Luda while China received military supplies and economic and technological aid. The USSR showed its support for China by boycotting UN meetings as long as the UN recognized the Republic of China (Taiwan) instead of the People's Republic of China. China also led the brunt of the Communist fighting during the Korean War, in which Communist North Korea invaded non-Communist South Korea. This period following the war marked the closest China had ever been with a foreign country.
However, following Stalin's death, a rift began to form. Khrushchev, once in power, began a process known as de-Stalinization to condemn the previous leader's actions, and he began forging closer relations with the Western powers. A number of further issues irritated the Chinese government, including the Soviet's lack of involvement with the Sino-Indian war and its empty promise to share nuclear technology with China. Following the extremely radical Great Leap Forward, a Communist economic strategy that ended in disaster and famine, all Soviet officials withdrew from China. Conflicting territorial claims on top of everything else led to the two nations to armed clashes.
The two severed diplomatic ties in 1966, and did not resume them until 1987. In the 1980s, still wary of the Soviet Union but dismissing the USSR as an immediate threat, China offered to resume relations once 3 conditions were met: Soviet withdrawal from Afghanistan, Soviet support for Vietnam's invasion of Cambodia, and Soviet military presence on the Sino-Soviet border and in Mongolia. The USSR refused to discuss these conditions for the first half of the decade.
Around the time that Brezhnev, Andropov, and Chernenko died, allowing new leadership to surface in the USSR, Sino-Soviet relations were improving. On the issue of economics and borders, the two countries were becoming much more open and friendly. Delegation exchanged resumed regularly. Gorbachev further mended the rift with his promise to hold discussions with China "at any time and at any level."
Sources: Ibiblio.org, fmprc.gov.cn, Country Studies.us,