Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: fix flaky test-memory-usage
abe6a2e introduced a test that verifies that ArrayBuffer
allocations are tracked. However, V8 supports concurrent freeing
of such allocations on background threads, meaning that the results
may be subject to race conditions sometimes.

Disabling concurrent freeing makes the test pass consistently.

Refs: #31550
  • Loading branch information
addaleax committed Feb 1, 2020
commit f0c3970d668e888c9061b30bda170ae9c646fa77
3 changes: 2 additions & 1 deletion test/parallel/test-memory-usage.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

// Flags: --no-concurrent-array-buffer-freeing
'use strict';
const common = require('../common');
const assert = require('assert');
Expand All @@ -41,5 +42,5 @@ if (r.arrayBuffers > 0) {
assert(after.external - r.external >= size,
`${after.external} - ${r.external} >= ${size}`);
assert.strictEqual(after.arrayBuffers - r.arrayBuffers, size,
`${after.arrayBuffers} - ${r.arrayBuffers} >= ${size}`);
`${after.arrayBuffers} - ${r.arrayBuffers} === ${size}`);
}