Skip to content

Commit

Permalink
Separate correctness and memory tests for ConcurrentMap, LockFreeStac…
Browse files Browse the repository at this point in the history
…k, and LockFreeQueue (#25392)

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`.

[Reviewed by @e-kayrakli]
  • Loading branch information
stonea authored Jul 1, 2024
2 parents 0e179b4 + 4e48dd0 commit b3ce944
Show file tree
Hide file tree
Showing 25 changed files with 66 additions and 12 deletions.
4 changes: 4 additions & 0 deletions test/library/packages/ConcurrentMap/memLeakTests/PREDIFF
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

grep -v "\.chpl:.*" < $2 >$2.predifftmp
mv $2.predifftmp $2
3 changes: 3 additions & 0 deletions test/library/packages/ConcurrentMap/memLeakTests/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This directory is locking down that we currently have a memory leak for
ConcurrentMap. These tests symlink to equivalent correctness tests and can be
removed once this leak is fixed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{1: -1}

================================================= Memory Leaks ==================================================
Allocated Memory (Bytes) Number Size Total Description Address
=================================================================================================================
=================================================================================================================

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{}

================================================= Memory Leaks ==================================================
Allocated Memory (Bytes) Number Size Total Description Address
=================================================================================================================
=================================================================================================================

10 changes: 10 additions & 0 deletions test/library/packages/ConcurrentMap/memLeakTests/testEquality.good
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
true
false
false
true

================================================= Memory Leaks ==================================================
Allocated Memory (Bytes) Number Size Total Description Address
=================================================================================================================
=================================================================================================================

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
1
{two: 2}

================================================= Memory Leaks ==================================================
Allocated Memory (Bytes) Number Size Total Description Address
=================================================================================================================
=================================================================================================================

Empty file.
1 change: 0 additions & 1 deletion test/library/packages/ConcurrentMap/testAddSet.future

This file was deleted.

1 change: 0 additions & 1 deletion test/library/packages/ConcurrentMap/testClear.future

This file was deleted.

1 change: 0 additions & 1 deletion test/library/packages/ConcurrentMap/testContains.future

This file was deleted.

1 change: 0 additions & 1 deletion test/library/packages/ConcurrentMap/testEquality.future

This file was deleted.

1 change: 0 additions & 1 deletion test/library/packages/ConcurrentMap/testExtend.future

This file was deleted.

1 change: 0 additions & 1 deletion test/library/packages/ConcurrentMap/testGetRemove.future

This file was deleted.

5 changes: 2 additions & 3 deletions test/library/packages/LockFreeQueue/PREDIFF
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash

sed -E "s/0x[0-9a-f]*/prediffed/" <$2 >$2.predifftmp
grep prediffed $2.predifftmp | uniq -c >$2
rm $2.predifftmp
grep -v "\.chpl:.*" < $2 >$2.predifftmp
mv $2.predifftmp $2
3 changes: 3 additions & 0 deletions test/library/packages/LockFreeQueue/memLeaks/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This directory is locking down that we currently have a memory leak for this
module. These tests symlink to equivalent correctness tests and can be removed
once this leak is fixed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

================================================= Memory Leaks ==================================================
Allocated Memory (Bytes) Number Size Total Description Address
=================================================================================================================
=================================================================================================================

5 changes: 2 additions & 3 deletions test/library/packages/LockFreeStack/PREDIFF
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash

sed -E "s/0x[0-9a-f]*/prediffed/" <$2 >$2.predifftmp
grep prediffed $2.predifftmp | uniq -c >$2
rm $2.predifftmp
grep -v "\.chpl:.*" < $2 >$2.predifftmp
mv $2.predifftmp $2
3 changes: 3 additions & 0 deletions test/library/packages/LockFreeStack/memLeaks/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This directory is locking down that we currently have a memory leak for this
module. These tests symlink to equivalent correctness tests and can be removed
once this leak is fixed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

================================================= Memory Leaks ==================================================
Allocated Memory (Bytes) Number Size Total Description Address
=================================================================================================================
=================================================================================================================

0 comments on commit b3ce944

Please sign in to comment.