An example: I originally setup an play in AVGO , a Dec 11 115/150 short strangle. Out of abundance of caution, I widened the setup, since I didn't want another "problem child" in my portfolio from this season to deal with.
announcement. Price skyrocketed. To a point uncomfortably near my short call strike at 150.
The short put -- no problem. Nearing worthless post , I closed it out, leaving me with the problematic 150 short call. With 4 days until expiration (and with a day job that basically prevents me from doing squat with my trades except over my lunch hour -- not ideal), I was naturally concerned that price would test that short call, even though it is still short of 150. I rolled it up to the Dec 18 152 .5 short call strike to give the trade a bit of additional time and in the hope that I could close it out for at least scratch, and I got a credit for doing that.
Long story short: if you anticipate a test of one of your short options, roll it away and out before it's tested if at all possible even if it's just for an additional week to allow the trade time to work itself out. You'll find that it's a lot easier to get a credit when you do that than when you attempt to do so post-test.