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

Fix karma tests memory issues #2851

Closed
barklund opened this issue Jun 30, 2020 · 4 comments · Fixed by #2887
Closed

Fix karma tests memory issues #2851

barklund opened this issue Jun 30, 2020 · 4 comments · Fixed by #2887
Assignees
Labels
Type: Bug Something isn't working Type: Infrastructure Changes impacting testing infrastructure or build tooling Type: Task Tasks which do not involve engineering

Comments

@barklund
Copy link
Contributor

Task Description

Karma tests often have memory issues and halt execution - even before actually starting running the tests.

This seems inconsistent but increasingly common, as tests grow more and more complex and comprehensive.

Possible fixes include:

  • Increasing memory limit
  • Fixing underlying memory leak (if any)

See this thread for discussion.

@barklund barklund added Type: Bug Something isn't working Type: Infrastructure Changes impacting testing infrastructure or build tooling Type: Task Tasks which do not involve engineering labels Jun 30, 2020
@barklund barklund added this to the Sprint 32 milestone Jun 30, 2020
@dvoytenko
Copy link
Contributor

I think I can confirm that it happens in the source map preprocessing. Here's the full debug log for the failure:

>> WebPack
✔ Stories Editor
  Compiled successfully in 133.37ms

30 06 2020 09:10:48.198:DEBUG [web-server]: Instantiating middleware
ℹ 「wdm」: Compiled successfully.
ℹ 「wdm」: Compiling...

✔ Stories Editor
  Compiled successfully in 58.80s

ℹ 「wdm」: Compiled with warnings.

>>> Fails between these two logs

30 06 2020 09:12:03.278:DEBUG [preprocessor.sourcemap]: base64-encoded source map for /Users/dvoytenko/DNI/web-stories-wp/assets/src/edit-story/components/canvas/karma/backgroundCopyPaste.karma.js

This most likely comes from this Karma configuration:

preprocessors: {
  'assets/src/edit-story/**/karma/**/*.js': ['webpack', 'sourcemap'],
},

Not clear what are all issues related to sourcemap here.

@dvoytenko
Copy link
Contributor

Here's something similar and suggested solution is here. This promises to speed up our test compilation time on WebPack quite a bit.

@barklund
Copy link
Contributor Author

The above configuration generates a webpack bundle for each test.

That sounds horrible! Yes, let's go for this alternative approach and pack them all in single bundle for CI.

@dvoytenko
Copy link
Contributor

PTAL: #2887

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working Type: Infrastructure Changes impacting testing infrastructure or build tooling Type: Task Tasks which do not involve engineering
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants