Skip to content

Sync WPT with upstream (28-06-2026) - #46043

Merged
Loirooriol merged 2 commits into
mainfrom
wpt_update_28-06-2026
Jul 2, 2026
Merged

Loirooriol merged 2 commits into
mainfrom
wpt_update_28-06-2026

Conversation

@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

Automated downstream sync of changes from upstream as of 28-06-2026
[no-wpt-sync]

@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jun 28, 2026
@servo-bot
servo-bot enabled auto-merge June 28, 2026 01:54
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Jun 28, 2026
@jdm

jdm commented Jun 28, 2026

Copy link
Copy Markdown
Member

web-platform-tests/wpt#60846

 ➤  Checking type annotations in python files ...

  | python/wpt/run.py:135: Object of class `NoneType` has no attribute `add_handler`

Not yet sure what to make of this.

servo/python/wpt/run.py

Lines 129 to 135 in 76cdccc

if use_mach_logging:
logger = wptrunner.setup_logging(kwargs, {"mach": sys.stdout})
else:
logger = wptrunner.setup_logging(kwargs, {"servo": sys.stdout})
handler = ServoHandler(detect_flakes=kwargs["retry_unexpected"] >= 1)
logger.add_handler(handler)

@jdm jdm added the S-fails-tidy `./mach test-tidy` reported errors. label Jun 28, 2026
@sagudev

sagudev commented Jun 28, 2026

Copy link
Copy Markdown
Member

maybe try # pyrefly: ignore on last line. I am not sure how we typecheck wpt files given that they are untyped.

@pylbrecht

pylbrecht commented Jun 28, 2026 •

Copy link
Copy Markdown
Contributor

maybe try # pyrefly: ignore on last line. I am not sure how we typecheck wpt files given that they are untyped.

I would second this. If setup_logging() is not typed, the static type checker might infer None as a return type, which would lead to

 ➤  Checking type annotations in python files ...

  | python/wpt/run.py:135: Object of class `NoneType` has no attribute `add_handler`

So either we add type annotations to the relevant parts, or we # pyrefly: ignore / # type: ignore as quick fix.

diff --git a/python/wpt/run.py b/python/wpt/run.py
index 0e20adbd74..8358f3ce6f 100644
--- a/python/wpt/run.py
+++ b/python/wpt/run.py
@@ -132,7 +132,7 @@
         logger = wptrunner.setup_logging(kwargs, {"servo": sys.stdout})
 
     handler = ServoHandler(detect_flakes=kwargs["retry_unexpected"] >= 1)
-    logger.add_handler(handler)
+    logger.add_handler(handler)  # type: ignore
 
     with tempfile.TemporaryDirectory(prefix="servo-") as config_dir:
         kwargs["binary_args"] += ["--config-dir", config_dir]

Or just ignoring that particular error (missing-attribute):

diff --git a/python/wpt/run.py b/python/wpt/run.py
index 0e20adbd74..8358f3ce6f 100644
--- a/python/wpt/run.py
+++ b/python/wpt/run.py
@@ -132,7 +132,7 @@
         logger = wptrunner.setup_logging(kwargs, {"servo": sys.stdout})
 
     handler = ServoHandler(detect_flakes=kwargs["retry_unexpected"] >= 1)
-    logger.add_handler(handler)
+    logger.add_handler(handler)  # type: ignore[missing-attribute]
 
     with tempfile.TemporaryDirectory(prefix="servo-") as config_dir:
         kwargs["binary_args"] += ["--config-dir", config_dir]

(FYI: I did not verify that it's missing-attribute.)

@mukilan

mukilan commented Jun 28, 2026

Copy link
Copy Markdown
Member

The issue is that new context manager for logging is returning


but the previous line is asserting a different variable.

self._logger and logger hold the same object, but the typechecker doesn't understand this. If the upstream had return logger, this would have fixed the problem.

For now I think we can just add assert logger is not None before the logger.add_handler call.

@Loirooriol

Copy link
Copy Markdown
Contributor

@mukilan Sounds good, do you want to update this with the fix?

Signed-off-by: Mukilan Thiyagarajan <[email protected]>
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jul 2, 2026
@servo-bot
servo-bot added this pull request to the merge queue Jul 2, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jul 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 2, 2026
@servo-highfive servo-highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jul 2, 2026
@mukilan
mukilan added this pull request to the merge queue Jul 2, 2026
@servo-highfive servo-highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Jul 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 2, 2026
@servo-highfive servo-highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jul 2, 2026
@mukilan
mukilan added this pull request to the merge queue Jul 2, 2026
@servo-highfive servo-highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Jul 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 2, 2026
@servo-highfive servo-highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jul 2, 2026
@Loirooriol
Loirooriol added this pull request to the merge queue Jul 2, 2026
@servo-highfive servo-highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Jul 2, 2026
Merged via the queue into main with commit 2c71d4c Jul 2, 2026
52 checks passed
@Loirooriol
Loirooriol deleted the wpt_update_28-06-2026 branch July 2, 2026 15:20
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed. S-fails-tidy `./mach test-tidy` reported errors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants