Merge "Use Duration instead of TimeUnit for waiting on windows" into main