Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(web-server): Socket.write TypeError in 0.10.0 #403

Closed
wants to merge 1 commit into from
Closed

fix(web-server): Socket.write TypeError in 0.10.0 #403

wants to merge 1 commit into from

Conversation

codeactual
Copy link

Commit

Stop 'run_complete' handler from passing boolean false to socket.end()
when the run results' exit code is non-zero.

Prevent the boolean from propagating to Socket.write and triggering
'invalid data' in 0.10.0.

Details

Versions

  • os: OSX 10.8 + Ubuntu 12.04.2 (VMware Fusion)
  • node: v0.10.0-linux-x64
  • chrome: 27.0.1440.0 canary
  • testacular: 0.6.0
  • mocha: 1.8.2

test.js

describe('really short example', function() {
  it('should throw', function() {
    throw new Error('end the world');
  });
});

testacular.conf.js

basePath = '';
files = [
  MOCHA,
  MOCHA_ADAPTER,
  'test.js'
];
reporters = ['progress'];
port = 9876;
runnerPort = 9100;
colors = true;
logLevel = LOG_WARN;
autoWatch = false;
browsers = [];
captureTimeout = 60000;
singleRun = false;

testacular run output, 1 run (unpatched)

Chrome 27.0 (Mac) really short example should throw FAILED
    Error: end the world
        at Context.<anonymous> (/var/dev/testacular-mocha-example/test.js:3:11)
Chrome 27.0 (Mac): Executed 1 of 1 (1 FAILED) (0.067 secs / NaN secs)

testacular start output, 1 run (unpatched)

Chrome 27.0 (Mac) really short example should throw FAILED
    Error: end the world
        at Context.<anonymous> (/var/dev/testacular-mocha-example/test.js:3:11)
Chrome 27.0 (Mac): Executed 1 of 1 (1 FAILED) (0.067 secs / NaN secs)
ERROR [testacular]: [TypeError: invalid data]
TypeError: invalid data
    at Socket.write (net.js:580:11)
    at Socket.Writable.end (_stream_writable.js:322:10)
    at Socket.end (net.js:380:31)
    at null.<anonymous> (/var/dev/testacular-mocha-example/node_modules/testacular/lib/server.js:169:16)
    at g (events.js:175:14)
    at EventEmitter.emit (events.js:117:20)
    at null.<anonymous> (/var/dev/testacular-mocha-example/node_modules/testacular/lib/server.js:124:21)
    at EventEmitter.emit (events.js:117:20)
    at onComplete (/var/dev/testacular-mocha-example/node_modules/testacular/lib/browser.js:76:13)
    at Socket.EventEmitter.emit [as $emit] (events.js:95:17)

net.js:580

testacular start output, 3 runs (patched)

Chrome 27.0 (Mac) really short example should throw FAILED
    Error: end the world
        at Context.<anonymous> (/var/dev/testacular-mocha-example/test.js:3:11)
Chrome 27.0 (Mac): Executed 1 of 1 (1 FAILED) (0.056 secs / NaN secs)
Chrome 27.0 (Mac) really short example should throw FAILED
    Error: end the world
        at Context.<anonymous> (/var/dev/testacular-mocha-example/test.js:3:11)
Chrome 27.0 (Mac): Executed 1 of 1 (1 FAILED) (0.032 secs / NaN secs)
Chrome 27.0 (Mac) really short example should throw FAILED
    Error: end the world
        at Context.<anonymous> (/var/dev/testacular-mocha-example/test.js:3:11)
Chrome 27.0 (Mac): Executed 1 of 1 (1 FAILED) (0.029 secs / NaN secs

Stop 'run_complete' handler from passing boolean false to socket.end()
when the run results' exit code is non-zero.

Prevent the boolean from propagating to Socket.write and triggering
'invalid data' in 0.10.0.
@dignifiedquire
Copy link
Member

Thanks a lot. I will have a closer look as soon as I find some time.

vojtajina added a commit that referenced this pull request Mar 20, 2013
@vojtajina vojtajina closed this in ca75aaf Mar 20, 2013
@vojtajina
Copy link
Contributor

@codeactual Thanks, you are right, this is broken with node 0.10.

However, this is not the right fix. This means testacular run will always exit with 0, rather than proper exit code. Btw, the results.exitCode is always a Number.

I hope this fixes the issue ca75aaf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants