Skip to content

Attempt to fix test__multiple_valid_image_files#4034

Merged
westonruter merged 23 commits intodevelopfrom
try/image-test-fix
Jan 15, 2020
Merged

Attempt to fix test__multiple_valid_image_files#4034
westonruter merged 23 commits intodevelopfrom
try/image-test-fix

Conversation

@kienstra
Copy link
Copy Markdown
Contributor

@kienstra kienstra commented Jan 7, 2020

Summary

This attempts to fix test__multiple_valid_image_files. That test had failed intermittently.

Following the example of Weston's work on a FasterImage test, this hosts an image in a Gist instead of amp-wp.org
https://github.com/willwashburn/fasterimage/blob/42d125a15dc124520aff2157bbed9a4b2d4f310a/tests/FasterImageTest.php#L117

The actual file could be hosted in a Gist in Weston's account, if this approach is valid.

Checklist

  • My pull request is addressing an open issue (please create one otherwise).
  • My code is tested and passes existing tests.
  • My code follows the Engineering Guidelines (updates are often made to the guidelines, check it out periodically).

@googlebot googlebot added the cla: yes Signed the Google CLA label Jan 7, 2020
@westonruter
Copy link
Copy Markdown
Member

The intention behind hosting the file on amp-wp.org was to avoid it being tied to anyone's GitHub account. Since GitHub isn't a CDN it should seem that loading a file from a Gist would be less reliable than loading it from a production website, not more reliable.

@kienstra
Copy link
Copy Markdown
Contributor Author

kienstra commented Jan 8, 2020

OK, good point.

@kienstra
Copy link
Copy Markdown
Contributor Author

kienstra commented Jan 8, 2020

The external-http build that had failed before just passed. But it had also passed sometimes before. I'll run that build a few more times just to test this, and then revert the previous commit aadfaa1

It looks like you can't re-run a passed build, so I made a commit to trigger another build.

@kienstra
Copy link
Copy Markdown
Contributor Author

kienstra commented Jan 8, 2020

Without aadfaa1, test__multiple_valid_image_files failed 1 of 2 times.

With aadfaa1, it passed 5 of 5 times.

Understanding that using a GitHub Gist isn't possible, I'll close this PR soon.

@westonruter
Copy link
Copy Markdown
Member

Using a GitHub Gist is possible, but it doesn't seem correct. There must be some other reason for why this is happening. Perhaps the issue is there is some Pantheon protection in place against a bots trying to DDoS? I don't see why that would be the case and only for one file (and a static one at that), but it's a possibility.

@kienstra
Copy link
Copy Markdown
Contributor Author

kienstra commented Jan 8, 2020

Yeah, I agree that it doesn't seem right to use a Gist.

It does seem strange that there's only one file failing in the test, I'm still not sure what the cause is.

@westonruter
Copy link
Copy Markdown
Member

What happens if the order of items in the array is changed, so this SVG is fetched first?

@kienstra
Copy link
Copy Markdown
Contributor Author

kienstra commented Jan 8, 2020

I'll try that.

Revert "Revert "Revert "Experiment with hosting a mock image on GitHub"""
This reverts commit 734e92b.
As Weston suggested,
in order to test if this still fails.
@kienstra
Copy link
Copy Markdown
Contributor Author

kienstra commented Jan 8, 2020

Hm, the same .svg file failed, even with it moved to the beginning of the array.

@westonruter
Copy link
Copy Markdown
Member

That somewhat rules out the timeout theory. So strange.

@westonruter
Copy link
Copy Markdown
Member

Let's try clearing the Travis caches...

@kienstra
Copy link
Copy Markdown
Contributor Author

kienstra commented Jan 8, 2020

Hm, it passed.

@westonruter
Copy link
Copy Markdown
Member

If it passes 5 times in a row, then I think we found the problem.

@kienstra
Copy link
Copy Markdown
Contributor Author

kienstra commented Jan 8, 2020

The external-http test passed, and I restarted it.

Use mainly the same configuration as in
FasterImage::handle().
I set the wrong order before,
this needs to always run teh curl assertions.
@kienstra
Copy link
Copy Markdown
Contributor Author

Unfortunately, I don't know why test__multiple_valid_image_files had failed.

4d7218c#diff-9d88cb48c8afba5f63546855275bb633R241 tested whether basic curl requests for https://amp-wp.org/wp-content/plugin-test-files/google.svg succeeded. And they did.

But FasterImage's curl requests use curl_multi_*.

When reproducing this locally by stepping through Xdebug breakpoints very slowly, there was never an exception when the curl request failed.

And it looks like FasterImage didn't throw exceptions in the failed Travis builds.

@kienstra
Copy link
Copy Markdown
Contributor Author

Hi @westonruter,
What do you think about the approach here, understanding it's not ideal?

The test is reliably passing. But like you mentioned, it'd be much better to know why it failed.

Also, if you'd like, maybe the Gist could be from your GitHub account.

Thanks, and have a great weekend.

@westonruter westonruter added this to the v1.4.3 milestone Jan 15, 2020
Copy link
Copy Markdown
Member

@westonruter westonruter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well. Let's just do it! 😄

@westonruter westonruter merged commit a3ba286 into develop Jan 15, 2020
@westonruter westonruter deleted the try/image-test-fix branch January 15, 2020 00:45
westonruter pushed a commit that referenced this pull request Jan 15, 2020
* Experiment with hosting a mock image on GitHub

Following the example of Weston's work
on a FasterImage test:
https://github.com/willwashburn/fasterimage/blob/42d125a15dc124520aff2157bbed9a4b2d4f310a/tests/FasterImageTest.php#L117

* Empty commit to trigger another Travis build

* Another empty commit to trigger another Travis build

* Revert "Experiment with hosting a mock image on GitHub"

This reverts commit aadfaa1.

* Yet another empty commit to trigger another Travis build

* Test if setting a lower timeout causes more test failures

Using Weston's snippet,
test if there are more failed images.

* Revert "Revert "Experiment with hosting a mock image on GitHub""

This reverts commit 2a513b3.

* Revert "Test if setting a lower timeout causes more test failures"

This reverts commit 12f51ea.

* Another empty commit to ensure the test still passes

* Revert entire diff of PR, now back in sync with develop

Revert "Revert "Revert "Experiment with hosting a mock image on GitHub"""
This reverts commit 734e92b.

* Move the .svg file that failed to the beginning of the test images

As Weston suggested,
in order to test if this still fails.

* Revert last commit, now no diff against the develop branch

This reverts commit c5a2912.

* Will revert: test if curl requests for images succeed

Use mainly the same configuration as in
FasterImage::handle().

* Change order of assertions so the plain curl test always runs

I set the wrong order before,
this needs to always run teh curl assertions.

* Empty commit to trigger another Travis build

* Another empty commit to trigger another Travis build

* Will revert: pass the --verbose flag to phpunit in .travis.yml

* Yet another empty commit to trigger another Travis build

* Revert entire PR except for temporary changes to .travis.yml

* Revert PR's diff from develop

* Again change the amp-wp.org URL to a Gist URL

Like before, as it looks like this
prevents the failed external-http test.
Still, I don't know why it failed before.

* Empty commit to trigger Travis build

So that there are a few passing
Travis builds to ensure this works.
westonruter added a commit that referenced this pull request Jan 15, 2020
…izer-augmented-validate-response-data

* 'develop' of github.com:ampproject/amp-wp: (41 commits)
  Apply workaround to fix test__multiple_valid_image_files (#4034)
  Update dependency @wordpress/compose to v3.10.0 (#4080)
  Update dependency @babel/cli to v7.8.3 (#4097)
  Update dependency @babel/plugin-transform-react-jsx to v7.8.3 (#4101)
  Update dependency @babel/plugin-proposal-class-properties to v7.8.3 (#4099)
  Update dependency @babel/polyfill to v7.8.3 (#4102)
  Update dependency @babel/plugin-proposal-object-rest-spread to… (#4100)
  Preserve styles applied via [style] attribute selectors
  Update dependency @wordpress/dom to v2.7.0 (#4083)
  Update dependency @wordpress/keycodes to v2.8.0 (#4090)
  Update dependency @wordpress/edit-post to v3.11.0 (#4086)
  Update dependency @wordpress/core-data to v2.10.0 (#4081)
  Update dependency @wordpress/server-side-render to v1.6.0 (#4093)
  Update dependency @wordpress/dom-ready to v2.6.0 (#4084)
  Update dependency @wordpress/components to v9 (#4094)
  Update dependency @wordpress/block-editor to v3.5.0 (#4078)
  Update dependency @wordpress/is-shallow-equal to v1.7.0 (#4089)
  Update dependency @wordpress/e2e-test-utils to v4.1.0 (#4085)
  Update dependency @wordpress/data to v4.12.0 (#4082)
  Update dependency @wordpress/rich-text to v3.10.0 (#4092)
  ...
@pierlon pierlon mentioned this pull request Jan 15, 2020
3 tasks
westonruter added a commit that referenced this pull request Feb 13, 2020
* tag '1.4.3': (22 commits)
  Update readme and screenshots for Stories removal (#4259)
  Open story export instructions in a new window (#4258)
  Bump version to 1.4.3-RC1
  Hide Stories options and add deprecation notice (#4219)
  Fix malformed conversion of relative action URLs for forms (#4250)
  Limit Stories experience to WP 5.3 & Gutenberg 7.1.0 (#4217)
  Prevent errors in admin bar filters from non-array arguments (#4207)
  Update @wordpress/e2e-test-utils dependency
  Revert update of mustache/mustache dependency
  Update composer.lock
  Update WP CLI to 2.4.0
  For WordPress.tv embed, Use an oembed filter instead of block filter (#4164)
  Update readme to add FAQs section (#4159)
  Apply workaround to fix test__multiple_valid_image_files (#4034)
  Ignore Story editor tests (#4043)
  Update amp-video embed regex pattern to include other Vimeo URL formats (#4051)
  Update amp-instagram embed regex (#4053)
  Update wp-dev-lib package (#4029)
  Fix conversion of forms with relative action URLs (#4003)
  Improve release instructions (#3995)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Signed the Google CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants