Skip to content

Commit 01509bc

Browse files
Trottaddaleax
authored andcommitted
test: move long-running test to sequential
test-buffer-creation-regression is flaky on some SmartOS hosts in CI, timing out. Move to sequential so it does not compete with other tests for resources. Reduce three test cases to just the one needed to identify the regression. PR-URL: #10161 Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Italo A. Casas <[email protected]>
1 parent d8dc890 commit 01509bc

File tree

2 files changed

+36
-41
lines changed

2 files changed

+36
-41
lines changed

‎test/parallel/test-buffer-creation-regression.js‎

Lines changed: 0 additions & 41 deletions
This file was deleted.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
'use strict';
2+
3+
constcommon=require('../common');
4+
constassert=require('assert');
5+
6+
functiontest(arrayBuffer,offset,length){
7+
constuint8Array=newUint8Array(arrayBuffer,offset,length);
8+
for(leti=0;i<length;i+=1){
9+
uint8Array[i]=1;
10+
}
11+
12+
constbuffer=Buffer.from(arrayBuffer,offset,length);
13+
for(leti=0;i<length;i+=1){
14+
assert.strictEqual(buffer[i],1);
15+
}
16+
}
17+
18+
constacceptableOOMErrors=[
19+
'Array buffer allocation failed',
20+
'Invalid array buffer length'
21+
];
22+
23+
constsize=8589934592;/* 1 << 33 */
24+
constoffset=4294967296;/* 1 << 32 */
25+
constlength=1000;
26+
letarrayBuffer;
27+
28+
try{
29+
arrayBuffer=newArrayBuffer(size);
30+
}catch(e){
31+
if(einstanceofRangeError&&acceptableOOMErrors.includes(e.message))
32+
returncommon.skip(`Unable to allocate ${size} bytes for ArrayBuffer`);
33+
throwe;
34+
}
35+
36+
test(arrayBuffer,offset,length);

0 commit comments

Comments
(0)