In Pennsylvania, and probably many other places, you are compelled to give testimony if you are properly given a subpoena by a party who seeks to discover facts which may be evidence in the case. However, if you feel that you have no information to give or if you object to the deposition for other reasons (e. g., the information is privileged) you should hire a lawyer who may suggest presenting a motion for a protective order to a judge.
Unfortunately, the law has a strong policy in favor of compelling testimony in litigation. You may be required to testify in the end.
Read more on my blog, Pittsburgh Legal Back Talk, http://www.pittsburghlegalbacktalk.com/
I am not licensed to practice law in Pennsylvania so the following should not be taken as legal advice, but simply as information based on general principles of law which is intended to educate. If you need legal advice, please consult a lawyer who holds Pennsylvania licensure.
If you have been subpoenaed to attend a deposition, you have to go and you can't leave until it's over. The lawyer who subpoenaed you is doing so on behalf of the court and with the power of the court. Typically attached to the subpoena is a bunch of printed material telling you the grounds for quashing a subpoena. For example, if you have to travel over, say, 50 miles to attend, you may not have to attend. There are a handful of reasons that a subpoena can be quashed. But if you received a valid subpoena signed by a lawyer commanding you to attend, most of the time you simply have to go. That's just the way it is.
If you have any question about whether you need to show up, consult a lawyer who holds Pennsylvania licensure and who has a litigation practice. They will be able to examine the subpoena and analyze whether there are any grounds for not complying with it.