Skip to content

Commit

Permalink
test: fix flaky test-memory-usage
Browse files Browse the repository at this point in the history
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

PR-URL: #31602
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
addaleax authored and targos committed Apr 28, 2020
1 parent 9d9e185 commit e5a64e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/parallel/test-memory-usage.js
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}`);
}

0 comments on commit e5a64e5

Please sign in to comment.