Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests: Restore site-data.spec.ts #1194

Merged
merged 7 commits into from
Apr 11, 2024
Merged

Conversation

adamziel
Copy link
Collaborator

@adamziel adamziel commented Apr 4, 2024

The test was removed in #1192 due to intermittent failures like these:

FAIL  src/lib/steps/site-data.spec.ts > Blueprint step setSiteOptions() > should set the site option

CleanShot 2024-04-04 at 13 09 25@2x

They seem related to #1189, but:

Is the CI runner just running out of memory? But then it shouldn't be able to allocate the memory segment in the first place. Weird!

CC @brandonpayton for insights

@adamziel adamziel added [Type] Enhancement New feature or request [Feature] PHP.wasm Tests [Type] Reliability Playground uptime, reliability, not crashing labels Apr 4, 2024
@adamziel
Copy link
Collaborator Author

adamziel commented Apr 4, 2024

I set the PHP version used in that test to 7.4 instead of 8.0 and now the tests pass. How weird!

@adamziel
Copy link
Collaborator Author

adamziel commented Apr 4, 2024

I set the PHP version used in that test to 8.0 again and they started failing in the same way.

@adamziel
Copy link
Collaborator Author

adamziel commented Apr 4, 2024

It doesn't even fail when setting the option, but when displaying it:

const response = await php.run({
	code: `<?php
                require '/wordpress/wp-load.php';
                echo get_option('blogname');
	`,
});

I wonder if some code path in there triggers a REST API request to api.wordpress.org. If yes, it could be an ASYNCIFY-related problem in disguise? I'm not sure what ZEND_SEND_ARRAY_SPEC_HANDLER is, as its error messages refer to both call_user_func_array() and array_slice(), but perhaps we need it in the ASYNCIFY functions list?

@adamziel adamziel added this to the Zero Crashes milestone Apr 4, 2024
@adamziel
Copy link
Collaborator Author

adamziel commented Apr 4, 2024

Adding ZEND_SEND_ARRAY_SPEC_HANDLER to ASYNCIFY_ONLY list didn't help. Perhaps that's a legitimate error, after all? But why wouldn't it fail locally?

@adamziel
Copy link
Collaborator Author

adamziel commented Apr 4, 2024

Also the E2E failure is interesting:

  1 failing
  1) Playground website UI
       PHP extensions bundle
         should not load additional PHP extensions when not requested:
     Error: The following error originated from your application code, not from Cypress. It was caused by an unhandled promise rejection.
  > Error when executing the blueprint step #0 ({"step":"login","username":"admin","password":"password"}) : Aborted(). Build with -sASSERTIONS for more info.
When Cypress detects uncaught errors originating from your application it will automatically fail the current test.
This behavior is configurable, and you can choose to turn this off by listening to the `uncaught:exception` event.
https://on.cypress.io/uncaught-exception-from-application
      at Object.run (http://localhost/assets/config-20ddff8d.js:623:14922)
      at async runBlueprintSteps (http://localhost/assets/config-20ddff8d.js:623:16785)
      at async startPlaygroundWeb (http://localhost/assets/config-20ddff8d.js:627:9538)

Here's the screenshot:

Playground website UI -- PHP extensions bundle -- should not load additional PHP extensions when not requested (failed)

@adamziel
Copy link
Collaborator Author

adamziel commented Apr 4, 2024

Interestingly, no related error reports came in on #playground-logs yet. I wonder if we're just hitting CI resource limits somehow, at least with respect to the E2E tests.

@adamziel
Copy link
Collaborator Author

adamziel commented Apr 4, 2024

Aha, I reverted PHP wasm to its version from before the memory leak PR and the tests passed. I'm going to revert #1189 until we can identify and resolve the crash.

adamziel added a commit that referenced this pull request Apr 4, 2024
Reverts #1189

Unfortunately, the current implementation triggers "memory access out of
bounds" errors in places they weren't happening before. See
#1194 for more
context.
@brandonpayton
Copy link
Member

So far, I have not had any luck reproducing this locally.

In the absence of a better way, I wonder if it is possible to run a test branch in CI with more error-logging to help narrow things down.

@brandonpayton
Copy link
Member

In the absence of a better way, I wonder if it is possible to run a test branch in CI with more error-logging to help narrow things down.

Just looked at the GH Actions tab, and it looks like running CI changes is exactly what happened for this PR. I'm planning to create a test PR for the memory leak fix and see if I can repro via CI at least.

@adamziel
Copy link
Collaborator Author

adamziel commented Apr 4, 2024

Reverting this branch to 096a017 would in theory get CI to fail again.

@adamziel adamziel force-pushed the restore-site-data-test branch from da45ceb to 096a017 Compare April 8, 2024 08:18
The test was removed in #1192 due to intermittent failures like these:

```
FAIL  src/lib/steps/site-data.spec.ts > Blueprint step setSiteOptions() > should set the site option
```

They seem related to #1189, but all the other tests pass and the
Playground website works so I wonder what's going on there. Is the CI
runner just running out of memory? But then it shouldn't be able to
allocate the memory segment in the first place. Weird!
@adamziel adamziel force-pushed the restore-site-data-test branch from 85c8ef6 to 9e75906 Compare April 11, 2024 21:57
@adamziel adamziel merged commit 581da69 into trunk Apr 11, 2024
4 of 5 checks passed
@adamziel adamziel deleted the restore-site-data-test branch April 11, 2024 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] PHP.wasm Tests [Type] Enhancement New feature or request [Type] Reliability Playground uptime, reliability, not crashing
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants