fix: codechef submit fixes and atcoder cleanup (#355)

## Problem

After the initial CodeChef implementation, submit silently swallowed
"contest not available for submission" errors, and the submit flow used
blind `wait_for_timeout` delays. AtCoder had an unnecessary 500ms settle
delay after file upload.

## Solution

Replace the initial page-load sleep in CodeChef submit with
`wait_for_selector`, replace the 3s post-click sleep with a proper
`wait_for_selector` on the result dialog, and extend the practice
fallback
check to catch both dialog variants. Remove AtCoder's
`BROWSER_SETTLE_DELAY`
and the constant from `timeouts.py`.
This commit is contained in:
Barrett Ruth 2026-03-06 23:40:12 -05:00 committed by GitHub
parent 3c11d609f5
commit 73e5c3f3f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 11 deletions

View file

@ -30,7 +30,6 @@ from .timeouts import (
BROWSER_ELEMENT_WAIT,
BROWSER_NAV_TIMEOUT,
BROWSER_SESSION_TIMEOUT,
BROWSER_SETTLE_DELAY,
BROWSER_SUBMIT_NAV_TIMEOUT,
BROWSER_TURNSTILE_POLL,
HTTP_TIMEOUT,
@ -500,7 +499,6 @@ def _submit_headless(
"buffer": Path(file_path).read_bytes(),
},
)
page.wait_for_timeout(BROWSER_SETTLE_DELAY)
page.locator('button[type="submit"]').click(no_wait_after=True)
page.wait_for_url(
lambda url: "/submissions/me" in url,