-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathstart-nodefz.js
221 lines (200 loc) · 8.17 KB
/
start-nodefz.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
const benchmarkDir = require('../benchmark_config')();
const ITERATIONS = 30; //number of repetitions/iterations (30 times used in the experiments)
const RUNS = 100; //number of runs for calculate bug reproduction ratio (100 used in experiments)
const runNodeFz = require('./comparison');
// To see the stdout of the tests, add property 'silent: false' to the object sent to function 'runNodeFz'
// header
console.log('iteration,runs,tool,benchmark,fails,firstfail');
let NODEFZ_COMMAND = `UV_THREADPOOL_SIZE=1 UV_SCHEDULER_TYPE=TP_FREEDOM UV_SCHEDULER_TP_DEG_FREEDOM=-1 UV_SCHEDULER_TP_MAX_DELAY=100 UV_SCHEDULER_TP_EPOLL_THRESHOLD=100 UV_SCHEDULER_TIMER_LATE_EXEC_TPERC=200 UV_SCHEDULER_IOPOLL_DEG_FREEDOM=-1 UV_SCHEDULER_IOPOLL_DEFER_PERC=10 UV_SCHEDULER_RUN_CLOSING_DEFER_PERC=5 UV_SILENT=1 UV_PRINT_SUMMARY=0 ${benchmarkDir}/NodeFz/out/Release/node`;
//------------------------------------------------------------------------------//
// #1 - AKA
runNodeFz({
iterations: ITERATIONS,
runs: RUNS,
strategy: 'Node.fz',
strategyCommand: NODEFZ_COMMAND,
benchmarkName: 'AKA',
benchmarkDir: `${benchmarkDir}/known-bugs/agentkeepalive-23`,
command: 'fuzz_test/triggerRace.js',
errorMessage: 'ECONNRESET'
});
//------------------------------------------------------------------------------//
// #2 - FPS
runNodeFz({
iterations: ITERATIONS,
runs: RUNS,
strategy: 'Node.fz',
strategyCommand: NODEFZ_COMMAND,
benchmarkName: 'FPS',
benchmarkDir: `${benchmarkDir}/known-bugs/fiware-pep-steelskin`,
command: 'node_modules/.bin/mocha test/unit/race_simple.js --timeout 10000',
errorMessage: '0 passing'
});
//------------------------------------------------------------------------------//
// #3 - GHO
runNodeFz({
iterations: ITERATIONS,
runs: RUNS,
strategy: 'Node.fz',
strategyCommand: NODEFZ_COMMAND,
benchmarkName: 'GHO',
benchmarkDir: `${benchmarkDir}/known-bugs/WhiteboxGhost`,
command: 'fuzz_test/add_mock.js',
errorMessage: 'FAILURE'
});
//------------------------------------------------------------------------------//
// #4 - MKD
runNodeFz({
iterations: ITERATIONS,
runs: RUNS,
strategy: 'Node.fz',
strategyCommand: NODEFZ_COMMAND,
benchmarkName: 'MKD',
benchmarkDir: `${benchmarkDir}/known-bugs/node-mkdirp`,
command: 'fuzz_test/race_subtle.js',
errorMessage: 'Failed run'
});
//------------------------------------------------------------------------------//
// #6 - NLF
let NODEFZ_COMMAND_CLF = `UV_THREADPOOL_SIZE=1 UV_SCHEDULER_TYPE=TP_FREEDOM UV_SCHEDULER_TP_DEG_FREEDOM=-1 UV_SCHEDULER_TP_MAX_DELAY=100 UV_SCHEDULER_TP_EPOLL_THRESHOLD=100 UV_SCHEDULER_TIMER_LATE_EXEC_TPERC=200 UV_SCHEDULER_IOPOLL_DEG_FREEDOM=-1 UV_SCHEDULER_IOPOLL_DEFER_PERC=10 UV_SCHEDULER_RUN_CLOSING_DEFER_PERC=5 UV_SILENT=1 UV_PRINT_SUMMARY=0 timeout 10 ${benchmarkDir}/NodeFz/out/Release/node`;
runNodeFz({
iterations: ITERATIONS,
runs: RUNS,
strategy: 'Node.fz',
strategyCommand: NODEFZ_COMMAND_CLF,
benchmarkName: 'NLF',
benchmarkDir: `${benchmarkDir}/known-bugs/node-logger-file-1`,
command: 'fuzz_test/triggerRace.js 10',
errorMessage: 'ERROR'
});
//------------------------------------------------------------------------------//
// #7 - SIO
let NODEFZ_COMMAND_SIO = `UV_THREADPOOL_SIZE=1 UV_SCHEDULER_TYPE=TP_FREEDOM UV_SCHEDULER_TP_DEG_FREEDOM=-1 UV_SCHEDULER_TP_MAX_DELAY=100 UV_SCHEDULER_TP_EPOLL_THRESHOLD=100 UV_SCHEDULER_TIMER_LATE_EXEC_TPERC=200 UV_SCHEDULER_IOPOLL_DEG_FREEDOM=-1 UV_SCHEDULER_IOPOLL_DEFER_PERC=10 UV_SCHEDULER_RUN_CLOSING_DEFER_PERC=5 UV_SILENT=1 UV_PRINT_SUMMARY=0 timeout 10 ${benchmarkDir}/NodeFz/out/Release/node`;
runNodeFz({
iterations: ITERATIONS,
runs: RUNS,
strategy: 'Node.fz',
strategyCommand: NODEFZ_COMMAND_SIO,
benchmarkName: 'SIO',
benchmarkDir: `${benchmarkDir}/known-bugs/socket.io-1862`,
command: 'fuzz_test/triggerRace-orig.js',
errorMessage: 'ERROR'
});
//------------------------------------------------------------------------------//
// #10 - simple-crawler
runNodeFz({
iterations: ITERATIONS,
runs: RUNS,
strategy: 'Node.fz',
strategyCommand: NODEFZ_COMMAND,
benchmarkName: 'NSC',
benchmarkDir: `${benchmarkDir}/known-bugs/node-simplecrawler-i298`,
command: 'merged-test.js',
errorMessage: 'no enough events performed before'
});
//------------------------------------------------------------------------------//
// #5 - NES
runNodeFz({
iterations: ITERATIONS,
runs: RUNS,
strategy: 'Node.fz',
strategyCommand: NODEFZ_COMMAND,
benchmarkName: 'NES',
benchmarkDir: `${benchmarkDir}/known-bugs/nes`,
command: 'node_modules/lab/bin/lab -v test/client_TP.js',
errorMessage: '1 of 1 tests failed',
silent: false
});
// ERROR
// Node.fz shows an error:
// default run gives a segmentation fault
// message: Segmentation fault (core dumped)
//------------------------------------------------------------------------------//
// #8 - DEL
runNodeFz({
iterations: ITERATIONS,
runs: RUNS,
strategy: 'Node.fz',
strategyCommand: NODEFZ_COMMAND,
benchmarkName: 'DEL',
benchmarkDir: `${benchmarkDir}/known-bugs/del`,
command: 'testissue43.js',
errorMessage: 'Error: ENOENT:',
silent: false
});
// ERROR
// Node.fz shows an error:
// node: ../deps/v8/src/isolate.cc:2678: void v8::internal::Isolate::RunMicrotasks(): Assertion `!"Isolate::RunMicrotasks: Not yet supported"' failed.
// Aborted (core dumped)
//------------------------------------------------------------------------------//
// #9 - LST
runNodeFz({
iterations: ITERATIONS,
runs: RUNS,
strategy: 'Node.fz',
strategyCommand: NODEFZ_COMMAND,
benchmarkName: 'LST',
benchmarkDir: `${benchmarkDir}/known-bugs/linter-stylint`,
command: 'syntetic/test.js',
errorMessage: 'showing wrong message:',
silent: false
});
// ERROR
// Node.fz did not support new features of JavaScript integrated in newer versions of Node.js
//
// Message:
// const { spawn } = require('child_process');
// ^
// SyntaxError: Unexpected token {
// at exports.runInThisContext (vm.js:53:16)
// at Module._compile (module.js:413:25)
// at Object.Module._extensions..js (module.js:452:10)
// at Module.load (module.js:355:32)
// at Function.Module._load (module.js:310:12)
// at Module.require (module.js:365:17)
// at require (module.js:384:17)
// at Object.<anonymous> (/home/git/noderacer-benchmark/linter-stylint/syntetic/test.js:1:78)
// at Module._compile (module.js:434:26)
// at Object.Module._extensions..js (module.js:452:10)
//------------------------------------------------------------------------------//
// #11 - XLS
runNodeFz({
iterations: ITERATIONS,
runs: RUNS,
strategy: 'Node.fz',
strategyCommand: NODEFZ_COMMAND,
benchmarkName: 'XLS',
benchmarkDir: `${benchmarkDir}/known-bugs/xlsx-extract`,
command: `node_modules/.bin/mocha test/tests.js -g 'should read all columns and rows'`,
errorMessage: '0 passing',
silent: false
});
// ERROR
// Node.fz did not support new features of JavaScript integrated in newer versions of Node.js
//
// Message:
// :~/git/noderacer$ node tests/benchmarks/nodefz/start-nodefz.js
// /xlsx-extract/node_modules/mocha/bin/mocha:12
// const {deprecate, warn} = require('../lib/utils');
// ^
// SyntaxError: Unexpected token {
// at exports.runInThisContext (vm.js:53:16)
// at Module._compile (module.js:413:25)
// at Object.Module._extensions..js (module.js:452:10)
// at Module.load (module.js:355:32)
// at Function.Module._load (module.js:310:12)
// at Function.Module.runMain (module.js:475:10)
// at startup (node.js:117:18)
// at node.js:952:3
// /home/git/noderacer-benchmark/xlsx-extract/node_modules/mocha/bin/mocha:12
// const {deprecate, warn} = require('../lib/utils');
// ^
// SyntaxError: Unexpected token {
// at exports.runInThisContext (vm.js:53:16)
// at Module._compile (module.js:413:25)
// at Object.Module._extensions..js (module.js:452:10)
// at Module.load (module.js:355:32)
// at Function.Module._load (module.js:310:12)
// at Function.Module.runMain (module.js:475:10)
// at startup (node.js:117:18)
// at node.js:952:3