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

Separate correctness and memory tests for ConcurrentMap, LockFreeStack, and LockFreeQueue #25392

Merged
merged 2 commits into from
Jul 1, 2024

Conversation

stonea
Copy link
Contributor

@stonea stonea commented Jun 28, 2024

All of our tests for ConcurrentMap, LockFreeStack, and LockFreeQueue are futures locking down behavior when using --memLeaks. This is a bit problematic because:

  • We weren't locking down the .bad behavior so these tests would never catch correctness issues.
  • For certain nightly jobs we skip futures (such as our nightly M1 Mac / ARM job).
  • We have infrastructure for tracking known memory leaks but this infrastructure doesn't expect the tests to be futures.

To reesolve all this, I've removed the futures and changed these to correctness tests when not using --memLeaks. I've also created separate symlinked versions of some of these tests that still run with --memLeaks. I didn't do this for all the tests since some of them have non-deterministic leaking behavior but I feel capturing this subset is sufficient for memory tracking purposes.

Edit: turns out all the tests have non deterministic memleaking behavior (I'm guessing based on maxTaskPar so I've ended up prediffing out the specifics of the memleak behavior and opting instead to just lock down that memory leaks occur).

Previously, we were locking down the expected memleak behavior for these
tests. Not all of our nightly jobs run futures but we would still like
to run these as correctness tests.

We also have infrastructure for detecting tests that leak memory so
it's better to leverage that rather than having these as futures
anyway.

So, I've rewritten these to not pass `--memLeaks` and then added some
separate "memLeak" only tests.

---
Signed-off-by: Andy Stone <[email protected]>
@stonea stonea requested a review from e-kayrakli June 28, 2024 20:00
---
Signed-off-by: Andy Stone <[email protected]>
@stonea stonea force-pushed the concurrent_map_tests branch from 62910f2 to 4e48dd0 Compare July 1, 2024 22:14
@stonea stonea merged commit b3ce944 into chapel-lang:main Jul 1, 2024
7 checks passed
@stonea stonea self-assigned this Jul 1, 2024
stonea added a commit that referenced this pull request Jul 1, 2024
…e doc for modules to indicate not x86 exclusive (#25413)

The following PR includes changes I should have merged into #25392.

Basically updating the docs for `LockFreeQueue`/`LockFreeStack` to
indicate they're no longer exclusive for x86 and remove the future files
for these modules now that these are meant to be correctness tests
(since the prior PR moved the memLeak tests into different dirs).

[Reviewed by nobody; simple fix for prior PR #25392]
stonea added a commit that referenced this pull request Jul 3, 2024
…/LockFreeQueue (#25422)

This should have been included as part of #25392. Basically I intended
to have some symlinks for memory tests for
`LockFreeStack`/`LockFreeQueue` but forgot to `git add` them to my
commit. This PR fixes it. Looking at last night's test jobs the
correctness tests part of that PR ran as expected.

[Reviewed by nobody; add files missing from prior PR]
stonea added a commit that referenced this pull request Jul 8, 2024
PR #25392 replaced a set of futures that were locking down that (for
ConcurrentMap, LockFreeQueue, and LockFreeStack) we failed with memory
leaks (when passing '--memLeaks') with normal correctness tests. To lock
down the known memory failures I also created a handful of other tests
that lock down the "known leak" when passing in '--memLeaks' by execopt
(this is the precedent we have for other known leaks as we have a script
that detects such tests).

Anyway, we don't want the pure correctness tests to fail on our memleak
job so we should skip them. This PR adjusts the skipif files to do that.

[Reviewed by nobody; simple test update]
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

Successfully merging this pull request may close these issues.

2 participants