If you declare bankruptcy SOLELY to delay a divorce trial, yes, it absolutely must delay the trial (as a result of the "automatic stay"), you could be sanctioned. If there was NO basis for the bankruptcy except to force a delay, the piper would eventually be paid. Speak to your bankruptcy attorney about this before taking action or filing a bankruptcy petition.
There must be a good reason for the court to delay a trial. The court will not permit not be happy with a litigant who seeks to delay a trial for an improper purpose.
In order to delay a trial, you must get the consent of your adversary and present the court with a legitimate reason for the delay. If you have a legitimate reason you should make your request immediately to your adversary and then the Court.
Generally speaking, courts do not like when cases are delayed. If you have a legitimate reason, such as a medical emergency of your own or jury duty of your own, then the courts will adjourn the trial. You may want to consult with an experienced divorce attorney to discuss your situation.
Agreeing with the above answers, I will also add that the delay to a divorce caused by a bankruptcy filign can be minimized if your divorce attorney files to have him or herself appointed as "special counsel" on behalf of the filer in the bankruptcy court. The divorce will in general be allowed to proceed following this step, depending on the chapter of bankruptcy and the procedural status of the petition at the time.