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

xt/examples-compilation.t is too memory-hungry and there are issues if we change EVAL to anything else #2764

Closed
taboege opened this issue May 5, 2019 · 10 comments
Labels
bug Error of some kind, from a typo to errors in the examples.

Comments

@taboege
Copy link
Member

taboege commented May 5, 2019

The problem

Running the full xt/examples-compilation.t test brings my laptop to its knees: the memory used just keeps growing, so that I have to run it twice with half the tests each. They are over 5000 tests currently, but loading all those into memory is not the problem. The memory usage keeps rising to critical levels while those tests are executed.

Suggestions

Look for memory leaks. It might also be worthwhile to do one subtest per file and avoid loading all the tests into memory at the beginning.

@JJ
Copy link
Contributor

JJ commented May 6, 2019 via email

@JJ JJ added the bug Error of some kind, from a typo to errors in the examples. label May 9, 2019
@JJ
Copy link
Contributor

JJ commented May 11, 2019

The problem is that tests might be written when there were only a few examples. Now there are some files that have hundreds of them. And examples are extracted, added to an array, and then tested...
I'll try and see the way of not keeping them in an array but testing them on the fly...

@JJ
Copy link
Contributor

JJ commented May 11, 2019

Opening it back again because of #2782. It might have something to do with this, since it happens only if the whole set is run.

@JJ JJ closed this as completed in 4311d97 May 12, 2019
@taboege
Copy link
Member Author

taboege commented May 12, 2019

Cool, thanks!

@coke
Copy link
Collaborator

coke commented May 17, 2019

I'm sad to see this go. We spent a lot of effort to speed up the runtime of tests, and I would have liked to see a ticket get opened in rakudo to track the memory issue.

There are, btw, many ways to run the the tests against just a subset of files, which avoids the cost of running the file against the whole suite of docs. (util/update-and-test, the TEST_FILES env var)

@JJ
Copy link
Contributor

JJ commented May 17, 2019

@coke It's not gone for any meaning of the word. It's just working in a different way. Why do you feel it's gone?

@JJ
Copy link
Contributor

JJ commented May 17, 2019

Ah, OK, the speed up is gone. We're trading memory for speed. It's not a big deal as long as you don't run the whole length of tests.
The memory issue is relatively simple, I guess. You're creating lots of stuff in a block with lexical scope and it's simply not been cleaned up. I don't think it's a bug per se, But if you feel it should be solved in some other way, please reopen and we can try and find ways to fix that.

@JJ
Copy link
Contributor

JJ commented May 17, 2019

@coke I see this 349ecc6 I don't think speed is such an issue nowadays but, again, if you feel it is, please reopen and let's chat.

@JJ JJ reopened this May 17, 2019
@JJ
Copy link
Contributor

JJ commented May 17, 2019

(I just clicked on the wrong button, so let's say do close it again if it's not an issue)

JJ added a commit that referenced this issue May 17, 2019
Thanks to @ugexe and @taboege for hints on how to make this. I've
checked memory, and it's actually taking quite a bit of memory, but
not as much as EVAL and it's actually faster than that.

It's also producing a false positive with `class
Metamodel::ParametricRoleHOW` which I don't know how to fix.

Refs #2764 but leaves it open until

* Memory usage has actually been addressed, and
* We manage to fix that false positive
@JJ JJ changed the title xt/examples-compilation.t is too memory-hungry xt/examples-compilation.t is too memory-hungry and there are issues if we change EVAL to anything else May 18, 2019
@JJ
Copy link
Contributor

JJ commented May 18, 2019

As @taboege pointed out, it's a flapper in the sense that it does not seem to error if we run that on the single file, it fails consistently if it's done on a group of files.

JJ added a commit that referenced this issue May 18, 2019
Which was incorrectly defined as class, which caused an error if it
was used before the definition of others that classified it as a
role. This closes #2782, refs #2764
@JJ JJ closed this as completed in 092921b May 18, 2019
taboege added a commit to taboege/doc that referenced this issue May 18, 2019
Refactor xt/examples-compilation.t to give each tested POD file its
own subtest. This restores a rough test plan and refs Raku#2798 without
giving up memory usage improvements for Raku#2764.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Error of some kind, from a typo to errors in the examples.
Projects
None yet
Development

No branches or pull requests

3 participants