tests: Force a blank config directory for each WPT test run. (#38078)

This ensures a consistent state when running tests that can otherwise
leave artifacts around (eg. localStorage/IndexedDB/cookies).

Testing: Existing test coverage is sufficient.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-07-15 01:38:38 -04:00 committed by GitHub
parent aa098ba2a3
commit 0e3165da01
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,6 +9,7 @@ import multiprocessing
import os
import re
import sys
import tempfile
import urllib.error
import urllib.parse
import urllib.request
@ -117,7 +118,11 @@ def run_tests(default_binary_path: str, **kwargs) -> int:
handler = ServoHandler(detect_flakes=kwargs["retry_unexpected"] >= 1)
logger.add_handler(handler)
wptrunner.run_tests(**kwargs)
with tempfile.TemporaryDirectory(prefix="servo-") as config_dir:
kwargs["binary_args"] += ["--config-dir", config_dir]
wptrunner.run_tests(**kwargs)
return_value = int(handler.any_stable_unexpected())
# Filter intermittents if that was specified on the command-line.