Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce maxParallelFileOps to limit parallel writes (#4570)
- Loading branch information
1 parent
0eb0427
commit b7e451c
Showing
96 changed files
with
441 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 28 additions & 0 deletions
28
test/chunking-form/samples/max-parallel-file-operations/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const assert = require('assert'); | ||
const { promises: fs } = require('fs'); | ||
const { wait } = require('../../../utils'); | ||
|
||
const fsWriteFile = fs.writeFile; | ||
let currentWrites = 0; | ||
let maxWrites = 0; | ||
|
||
module.exports = { | ||
description: 'maxParallelFileOps limits write operations', | ||
options: { | ||
maxParallelFileOps: 3, | ||
output: { preserveModules: true } | ||
}, | ||
before() { | ||
fs.writeFile = async (path, content) => { | ||
currentWrites++; | ||
maxWrites = Math.max(maxWrites, currentWrites); | ||
await fsWriteFile(path, content); | ||
await wait(50); | ||
currentWrites--; | ||
}; | ||
}, | ||
after() { | ||
fs.writeFile = fsWriteFile; | ||
assert.strictEqual(maxWrites, 3, 'Wrong number of parallel file writes: ' + maxWrites); | ||
} | ||
}; |
9 changes: 9 additions & 0 deletions
9
test/chunking-form/samples/max-parallel-file-operations/_expected/amd/1.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
define(['exports'], (function (exports) { 'use strict'; | ||
|
||
const x1 = 1; | ||
|
||
exports.x1 = x1; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
})); |
9 changes: 9 additions & 0 deletions
9
test/chunking-form/samples/max-parallel-file-operations/_expected/amd/2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
define(['exports'], (function (exports) { 'use strict'; | ||
|
||
const x2 = 2; | ||
|
||
exports.x2 = x2; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
})); |
9 changes: 9 additions & 0 deletions
9
test/chunking-form/samples/max-parallel-file-operations/_expected/amd/3.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
define(['exports'], (function (exports) { 'use strict'; | ||
|
||
const x3 = 3; | ||
|
||
exports.x3 = x3; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
})); |
9 changes: 9 additions & 0 deletions
9
test/chunking-form/samples/max-parallel-file-operations/_expected/amd/4.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
define(['exports'], (function (exports) { 'use strict'; | ||
|
||
const x4 = 4; | ||
|
||
exports.x4 = x4; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
})); |
9 changes: 9 additions & 0 deletions
9
test/chunking-form/samples/max-parallel-file-operations/_expected/amd/5.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
define(['exports'], (function (exports) { 'use strict'; | ||
|
||
const x5 = 5; | ||
|
||
exports.x5 = x5; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
})); |
13 changes: 13 additions & 0 deletions
13
test/chunking-form/samples/max-parallel-file-operations/_expected/amd/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
define(['exports', './1', './2', './3', './4', './5'], (function (exports, _1, _2, _3, _4, _5) { 'use strict'; | ||
|
||
|
||
|
||
exports.x1 = _1.x1; | ||
exports.x2 = _2.x2; | ||
exports.x3 = _3.x3; | ||
exports.x4 = _4.x4; | ||
exports.x5 = _5.x5; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
})); |
7 changes: 7 additions & 0 deletions
7
test/chunking-form/samples/max-parallel-file-operations/_expected/cjs/1.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
const x1 = 1; | ||
|
||
exports.x1 = x1; |
7 changes: 7 additions & 0 deletions
7
test/chunking-form/samples/max-parallel-file-operations/_expected/cjs/2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
const x2 = 2; | ||
|
||
exports.x2 = x2; |
7 changes: 7 additions & 0 deletions
7
test/chunking-form/samples/max-parallel-file-operations/_expected/cjs/3.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
const x3 = 3; | ||
|
||
exports.x3 = x3; |
7 changes: 7 additions & 0 deletions
7
test/chunking-form/samples/max-parallel-file-operations/_expected/cjs/4.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
const x4 = 4; | ||
|
||
exports.x4 = x4; |
7 changes: 7 additions & 0 deletions
7
test/chunking-form/samples/max-parallel-file-operations/_expected/cjs/5.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
const x5 = 5; | ||
|
||
exports.x5 = x5; |
17 changes: 17 additions & 0 deletions
17
test/chunking-form/samples/max-parallel-file-operations/_expected/cjs/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
var _1 = require('./1.js'); | ||
var _2 = require('./2.js'); | ||
var _3 = require('./3.js'); | ||
var _4 = require('./4.js'); | ||
var _5 = require('./5.js'); | ||
|
||
|
||
|
||
exports.x1 = _1.x1; | ||
exports.x2 = _2.x2; | ||
exports.x3 = _3.x3; | ||
exports.x4 = _4.x4; | ||
exports.x5 = _5.x5; |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/max-parallel-file-operations/_expected/es/1.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const x1 = 1; | ||
|
||
export { x1 }; |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/max-parallel-file-operations/_expected/es/2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const x2 = 2; | ||
|
||
export { x2 }; |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/max-parallel-file-operations/_expected/es/3.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const x3 = 3; | ||
|
||
export { x3 }; |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/max-parallel-file-operations/_expected/es/4.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const x4 = 4; | ||
|
||
export { x4 }; |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/max-parallel-file-operations/_expected/es/5.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const x5 = 5; | ||
|
||
export { x5 }; |
5 changes: 5 additions & 0 deletions
5
test/chunking-form/samples/max-parallel-file-operations/_expected/es/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export { x1 } from './1.js'; | ||
export { x2 } from './2.js'; | ||
export { x3 } from './3.js'; | ||
export { x4 } from './4.js'; | ||
export { x5 } from './5.js'; |
Oops, something went wrong.