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

CI unit tests slow and/or skipped #1167

Open
SimonMarquis opened this issue Sep 23, 2023 · 3 comments
Open

CI unit tests slow and/or skipped #1167

SimonMarquis opened this issue Sep 23, 2023 · 3 comments

Comments

@SimonMarquis
Copy link
Contributor

SimonMarquis commented Sep 23, 2023

Expected Behavior

The CI test suite should run fairly quickly.

Current Behavior

  • io.mockk.it.ParallelTest#test() takes ~2min 37s
    It was introduced in 6aa4827 and the repeat(500) { verify {...} } is what takes the majority of its time.
    Do we need this many iterations (30 parallels of 500 calls) to test the right behavior? And could it be tested differently?
  • io.mockk.it.ProxyWeakReferenceTest#test() is always skipped on CI, but fails locally.
    It currently draws ~20G of heap space to run with the current configuration 🤯
    The test tries to allocate ByteArray(10 * 1024 * 1024) (10MiB) * 1000.
    Allocating this many ByteArray should not be an issue, and actually, replacing the spyked call with something else correctly GC. This certainly means there is a memory leak happening from the spyk method call!

References:

@SimonMarquis
Copy link
Contributor Author

The GC root of these spyk objects:

image

@SimonMarquis
Copy link
Contributor Author

Not sure why exactly, but reverting this commit fc4b0c5 seems to make this test pass correctly (although JvmMockKProxyMakerTest#garbageCollectedProxy() now fails with MockKAgentException: Value for this result is not assigned)

@milgner
Copy link
Contributor

milgner commented Dec 22, 2023

Seeing the same behaviour on my system. While working on a potential fix for #1170 I found myself unable to run the full test suite on my system without running into OutOfMemoryError. Then I reverted the commit as suggested by @SimonMarquis and the tests passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants