Make WordPress Core

Opened 3 months ago

Closed 2 months ago

#60865 closed defect (bug) (fixed)

Some PHPUnit Tests are failing

Reported by: dextorlobo's profile dextorlobo Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.5.3 Priority: normal
Severity: normal Version: 6.5
Component: Build/Test Tools Keywords: has-patch has-unit-tests fixed-major dev-reviewed
Focuses: Cc:

Description

Some PHPUnit Tests are failing in wordpress-develop repo due to dummy images are not returning expected results.

Steps to reproduce:

  1. Raise a new PR in wordpress-develop repo against trunk
  2. Automatic tests start run
  3. Some tests will get fail

These test failure will be blocker for new PRs.

Attachments (1)

60865.diff (5.4 KB) - added by SergeyBiryukov 2 months ago.

Download all attachments as: .zip

Change History (51)

This ticket was mentioned in PR #6336 on WordPress/wordpress-develop by @dextorlobo.


3 months ago
#1

  • Keywords has-patch has-unit-tests added

Some PHPUnit Tests are failing in wordpress-develop repo due to dummy images are not returning expected results.

Steps to reproduce:

  • Raise a new PR in wordpress-develop repo against trunk
  • Automatic tests start run
  • Some tests will get fail

Screenshot of issue:
https://github.com/WordPress/wordpress-develop/assets/29377089/3599c4e5-5248-4c46-9cab-883e83e8bfa4

Fixes:
I have replaced the dummy images which were causing the issue with other dummy.

Trac ticket: https://core.trac.wordpress.org/ticket/60865#ticket

This ticket was mentioned in Slack in #core by dextorlobo. View the logs.


3 months ago

#3 @swissspidy
3 months ago

  • Focuses performance coding-standards removed
  • Severity changed from blocker to normal

#4 @SergeyBiryukov
3 months ago

  • Milestone changed from Awaiting Review to 6.6
  • Owner set to SergeyBiryukov
  • Status changed from new to accepted

#5 @SergeyBiryukov
3 months ago

In 57903:

Tests: Update expectations in wp_remote_head() and wp_remote_get() tests.

It appears that something has changed on the WP.com side to compress the requested images on the fly, which interfered with the previous expectations in these tests.

This commit uses a direct file URL and updates the expected image size to match the currently returned response.

Follow-up to [139/tests], [31258], [47142].

Props dextorlobo, swissspidy, davidbaumwald, SergeyBiryukov.
See #60865.

#6 @SergeyBiryukov
3 months ago

In 57904:

Tests: Revert the image size change in wp_remote_head() and wp_remote_get() tests.

The exact size in the response appears to differ between platforms, but this should make the tests pass for now.

Follow-up to [57903].

See #60865.

This ticket was mentioned in Slack in #core by sergey. View the logs.


3 months ago

#8 @audrasjb
3 months ago

  • Keywords fixed-major dev-feedback added
  • Milestone changed from 6.6 to 6.5

Moving to 6.5 for backport consideration.

#9 @audrasjb
3 months ago

  • Keywords dev-reviewed added; dev-feedback removed

#10 @audrasjb
3 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 57908:

Tests: Update expectations in wp_remote_head() and wp_remote_get() tests.

It appears that something has changed on the WP.com side to compress the requested images on the fly, which interfered with the previous expectations in these tests.

Follow-up to [139/tests], [31258], [47142].

Reviewed by audrasjb.
Merges [57903] and [57904] to the 6.5 branch.
Props dextorlobo, swissspidy, davidbaumwald, SergeyBiryukov.
Fixes #60865.

@SergeyBiryukov commented on PR #6336:


3 months ago
#11

Thanks for the PR! Merged a slightly modified version in r57903.

#12 follow-up: @SergeyBiryukov
3 months ago

For some reason, the tests still fail for me locally after [57904] due to the difference in image sizes:

There were 4 failures:

1) Tests_Functions_wpRemoteFopen::test_wp_remote_fopen
Failed asserting that 31325 is identical to 40148.

tests/phpunit/tests/functions/wpRemoteFopen.php:34

2) Tests_HTTP_Functions::test_head_request
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@                                                                                                                                              -'40148'
+'31325'

tests/phpunit/tests/http/functions.php::24

3) Tests_HTTP_Functions::test_get_request
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'40148'
+'31325'

tests/phpunit/tests/http/functions.php::69

4) Tests_HTTP_Functions::test_get_redirect
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'40148'
+'31325'

tests/phpunit/tests/http/functions.php:90

This happens on Windows and Ubuntu, but the same tests seem to pass on GitHub Actions. This could use some more investigation, or perhaps a more stable URL could be used for these requests.

Version 0, edited 3 months ago by SergeyBiryukov (next)

#13 @jorbin
3 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

I think this will need to be merged to all branches receiving courtesy security updates

#14 @jorbin
3 months ago

In 57930:

Tests: Update expectations in wp_remote_head() and wp_remote_get() tests.

It appears that something has changed on the WP.com side to compress the requested images on the fly, which interfered with the previous expectations in these tests.

This commit uses a direct file URL and updates the expected image size to match the currently returned response.

Follow-up to [139/tests], [31258], [47142].

Reviewed by jorbin.
Merges [57903] to the 6.4 branch.

Props dextorlobo, swissspidy, davidbaumwald, SergeyBiryukov.
See #60865.

#15 in reply to: ↑ 12 @SergeyBiryukov
3 months ago

Replying to SergeyBiryukov:

This happens on Windows and Ubuntu, but the same tests seem to pass on GitHub Actions. This could use some more investigation, or perhaps a more stable URL could be used for these requests.

60865.diff switches to a WordPress.org URL, this should be more stable in the long run.

This ticket was mentioned in PR #6363 on WordPress/wordpress-develop by @SergeyBiryukov.


2 months ago
#16

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Trac ticket: https://core.trac.wordpress.org/ticket/60865

#17 @SergeyBiryukov
2 months ago

In 57931:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Props peterwilsoncc, jorbin.
See #60865.

@SergeyBiryukov commented on PR #6363:


2 months ago
#18

Merged in r57931.

#19 @SergeyBiryukov
2 months ago

  • Keywords dev-feedback added; dev-reviewed removed
  • Milestone changed from 6.5 to 6.5.1

Marking [57931] for backporting to 6.5 and older branches after a second committer's review.

#20 @jorbin
2 months ago

This looks good for backporting. I've run the external-http tests vs 6.5, 6.4, and 6.3

#21 @jorbin
2 months ago

  • Keywords dev-reviewed added; dev-feedback removed

#22 @SergeyBiryukov
2 months ago

In 57935:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Reviewed by jorbin.
Merges [57931] to the 6.5 branch.

Props peterwilsoncc, jorbin.
See #60865.

#23 @SergeyBiryukov
2 months ago

In 57938:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 6.4 branch.

Props peterwilsoncc, jorbin.
See #60865.

#24 @SergeyBiryukov
2 months ago

In 57939:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 6.3 branch.

Props peterwilsoncc, jorbin.
See #60865.

#25 @SergeyBiryukov
2 months ago

In 57940:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 6.2 branch.

Props peterwilsoncc, jorbin.
See #60865.

#26 @SergeyBiryukov
2 months ago

In 57941:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 6.1 branch.

Props peterwilsoncc, jorbin.
See #60865.

#27 @SergeyBiryukov
2 months ago

In 57942:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 6.0 branch.

Props peterwilsoncc, jorbin.
See #60865.

#28 @davidbaumwald
2 months ago

  • Milestone changed from 6.5.1 to 6.5.2

Milestone renamed

#29 @jorbin
2 months ago

  • Milestone changed from 6.5.2 to 6.5.3

#30 @SergeyBiryukov
2 months ago

In 57992:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 5.9 branch.

Props peterwilsoncc, jorbin.
See #60865.

#31 @SergeyBiryukov
2 months ago

In 57993:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 5.8 branch.

Props peterwilsoncc, jorbin.
See #60865.

#32 @SergeyBiryukov
2 months ago

In 57994:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 5.7 branch.

Props peterwilsoncc, jorbin.
See #60865.

#33 @SergeyBiryukov
2 months ago

In 57995:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 5.6 branch.

Props peterwilsoncc, jorbin.
See #60865.

#34 @SergeyBiryukov
2 months ago

In 57996:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 5.5 branch.

Props peterwilsoncc, jorbin.
See #60865.

#35 @SergeyBiryukov
2 months ago

In 57997:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 5.4 branch.

Props peterwilsoncc, jorbin.
See #60865.

#36 @SergeyBiryukov
2 months ago

In 57998:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 5.3 branch.

Props peterwilsoncc, jorbin.
See #60865.

#37 @SergeyBiryukov
2 months ago

In 57999:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 5.2 branch.

Props peterwilsoncc, jorbin.
See #60865.

#38 @SergeyBiryukov
2 months ago

In 58000:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 5.1 branch.

Props peterwilsoncc, jorbin.
See #60865.

#39 @SergeyBiryukov
2 months ago

In 58001:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 5.0 branch.

Props peterwilsoncc, jorbin.
See #60865.

#40 @SergeyBiryukov
2 months ago

In 58002:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 4.9 branch.

Props peterwilsoncc, jorbin.
See #60865.

#41 @SergeyBiryukov
2 months ago

In 58003:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 4.8 branch.

Props peterwilsoncc, jorbin.
See #60865.

#42 @SergeyBiryukov
2 months ago

In 58006:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 4.7 branch.

Props peterwilsoncc, jorbin.
See #60865.

#43 @SergeyBiryukov
2 months ago

In 58007:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 4.6 branch.

Props peterwilsoncc, jorbin.
See #60865.

#44 @SergeyBiryukov
2 months ago

In 58008:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 4.5 branch.

Props peterwilsoncc, jorbin.
See #60865.

#45 @SergeyBiryukov
2 months ago

In 58012:

Tests: Revert the case change for expected headers in HTTP tests for the 4.5 branch.

Prior to [37428], the headers returned by wp_remote_retrieve_headers() were case-sensitive.

Follow-up to [37428], [38730], [58008].

See #60865.

#46 @SergeyBiryukov
2 months ago

In 58013:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 4.4 branch.

Props peterwilsoncc, jorbin.
See #60865.

#47 @SergeyBiryukov
2 months ago

In 58014:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 4.3 branch.

Props peterwilsoncc, jorbin.
See #60865.

#48 @SergeyBiryukov
2 months ago

In 58015:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 4.2 branch.

Props peterwilsoncc, jorbin.
See #60865.

#49 @SergeyBiryukov
2 months ago

In 58016:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 4.1 branch.

Props peterwilsoncc, jorbin.
See #60865.

#50 @SergeyBiryukov
2 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.