If I was not compensated and had to sign a non-compete to keep my job will it hold up in court? Also if that company goes bankrupt does that free me of my non-compete?
Minnesota does honor non-competes, typically those that focus on trade secrets and are reasonable in duration and scope. You're best off having a MN employment/contract lawyer review yours to see if it's enforceable and to see if the circumtsnaces under which you signed it affect its enforceability.
As a practical matter, if the company goes bankrupt and is not reorganized into some new entity that takes over its contractual rights, there won't be anyone to sue you for any violation of the non-compete. But if there is a new entity that succeeds to the rights, there could be.
Disclaimer: Please note that this answer does not constitute legal advice, and should not be relied on, since each state has different laws, each situation is fact specific, and it is impossible to evaluate a legal problem without a comprehensive consultation and review of all the facts and documents at issue. This answer does not create an attorney-client relationship.