Some refrigerators use a mechanical cold control like this one:
for regulating the temperature inside the compartments. These controls have a feeler capillary tube attached to the body of the cold control. Inside the body, changes in temperature, as picked up by the capillary tube, cause the bellows to expand and contract which, in turn, causes a set of electrical contacts to open and close. These contacts control the line power to the compressor and need to be closed for the compressor to run.
When troubleshooting a refrigerator that's warming up and you notice the compressor isn't running, one of the things you'll need to check the cold control. You could check continuity of the contacts and think the control is good but beware the adage that's been indelibly etched into the minds and hearts of all seasoned appliantological warriors: Ohms checking is merely preliminary-- something can check good on ohms and still be bad. Never accept an ohms check as conclusive proof that something is good.
Professor Willie offers some additional insight into the failure modes of mechanical cold controls:
That is actually one of the more common failure modes of a cold control to be intermittent.
If you pull the old one apart after you replace it, I can pretty much guarantee that you will find the contact points look quite crispy and melted.
One good way to know this is your problem is when you find that the unit it off and starting to thaw out, don't turn or touch the control dial, just give the control area a good slap and if it starts when you do that you can be pretty much assured you have a bad cold control, (the jolt or turning it up or off/on will make the contacts connect again until it opens and tries to close on its own).