catdad / grandma

👵 fully programmable stress testing framework
20 stars 4 forks source link

API hangs during some API usage? #183

Closed catdad closed 6 years ago

catdad commented 6 years ago

Repro code:

const fs = require('fs');
const path = require('path');
const grandma = require('grandma');

const out = fs.createWriteStream('out.txt');

grandma.run({
  test: {
    name: 'Test',
    path: path.resolve('./path/to/file.js'),
  },
  duration: '2s',
  concurrent: 1,
  output: out,
}, (err) => {
  console.log('done', err);
});

Test file:

module.exports = {
  test(done) {
    setTimeout(done, 100);
  },
};
catdad commented 6 years ago

In v0.6.9, where the process does not hang, this is reported as running in the callback:

# PROMISE
/mnt/c/Users/kvatev/Documents/GitHub/bench-test/node_modules/lodash/lodash.js:6069  - (Promise && getTag(Promise.resolve()) != promiseTag) ||
/mnt/c/Users/kvatev/Documents/GitHub/bench-test/node_modules/lodash/lodash.js:17078 - var _ = runInContext();
/mnt/c/Users/kvatev/Documents/GitHub/bench-test/node_modules/lodash/lodash.js:17105 - }.call(this));

# PROMISE
/mnt/c/Users/kvatev/Documents/GitHub/bench-test/node_modules/lodash.isequal/index.js:1373 - (Promise && getTag(Promise.resolve()) != promiseTag) ||

# TTYWRAP
/mnt/c/Users/kvatev/Documents/GitHub/bench-test/lib/is-stream.js:16   - return stream === process.stdin ||
/mnt/c/Users/kvatev/Documents/GitHub/bench-test/lib/run-utils.js:62   - if (isStream.stdio(stream)) {
/mnt/c/Users/kvatev/Documents/GitHub/bench-test/lib/run-utils.js:69   - var output = wrapStream(opts.output);
/mnt/c/Users/kvatev/Documents/GitHub/bench-test/lib/forkmaster.js:61  - var util = utils(_.merge({}, opts, {
/mnt/c/Users/kvatev/Documents/GitHub/bench-test/lib/forkmaster.js:344 - return start(options, callback);
/mnt/c/Users/kvatev/Documents/GitHub/bench-test/lib/run.js:78         - return forkmaster(_.merge({

# PROCESSWRAP
/mnt/c/Users/kvatev/Documents/GitHub/bench-test/lib/forkmaster.js:194               - var worker = child.fork(forkFile, ['--worker=' + id]);
/mnt/c/Users/kvatev/Documents/GitHub/bench-test/node_modules/lodash/lodash.js:976   - result[index] = iteratee(index);
/mnt/c/Users/kvatev/Documents/GitHub/bench-test/node_modules/lodash/lodash.js:16116 - var result = baseTimes(length, iteratee);
/mnt/c/Users/kvatev/Documents/GitHub/bench-test/lib/forkmaster.js:192               - _.times(threads, function() {
/mnt/c/Users/kvatev/Documents/GitHub/bench-test/lib/forkmaster.js:344               - return start(options, callback);

# PIPEWRAP
/mnt/c/Users/kvatev/Documents/GitHub/bench-test/lib/forkmaster.js:194             - var worker = child.fork(forkFile, ['--worker=' + id]);
/mnt/c/Users/kvatev/Documents/GitHub/bench-test/node_modules/lodash/lodash.js:976 - result[index] = iteratee(index);

# FSREQWRAP
/mnt/c/Users/kvatev/Documents/GitHub/bench-test/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:531 - var ret = dest.write(chunk);

# FSREQWRAP
/mnt/c/Users/kvatev/Documents/GitHub/bench-test/node_modules/graceful-fs/graceful-fs.js:38 - return fs$close.call(fs, fd, function (err) {

# Immediate
/mnt/c/Users/kvatev/Documents/GitHub/bench-test/lib/forkmaster.js:81 - setImmediate(callback);
/mnt/c/Users/kvatev/Documents/GitHub/bench-test/lib/forkmaster.js:97 - callbackAsync();

# TickObject
(unknown stack trace)

# TickObject
(unknown stack trace)

# TickObject
(unknown stack trace)
catdad commented 6 years ago

Appears to have broken in this commit: 4e3a2886521b2598f44665ffbac333e21d515c37

catdad commented 6 years ago

Published in v0.9.0.