Your flight is late enough that should be fine. The US wants the test, not Canada, so you'll be good getting off the ship. I'm not sure that all US carriers have global roaming 5G yet, so you may need a strong enough wifi connection or get tested at one of the facilities in Vancouver.