karma-runner / karma-teamcity-reporter

A Karma plugin. Report results for Teamcity CI.
MIT License
34 stars 47 forks source link

Error: EAGAIN: resource temporarily unavailable, write #38

Closed sebasrodriguez closed 6 years ago

sebasrodriguez commented 8 years ago

This error started to appear when updated to node 6.0

It appears randomly when executing a large set of tests.

This is the full stack of the error:

Error: EAGAIN: resource temporarily unavailable, write
    at Error (native)
    at Function.fs.writeSync (fs.js:786:18)
    at /Users/srodriguez/test_project/node_modules/karma/lib/reporters/base.js:51:7
    at Array.forEach (native)
    at write (/Users/srodriguez/test_project/node_modules/karma/lib/reporters/base.js:50:19)
    at flushLogs (/Users/srodriguez/test_project/node_modules/karma-teamcity-reporter/index.js:129:14)
    at getLog (/Users/srodriguez/test_project/node_modules/karma-teamcity-reporter/index.js:117:12)
    at specSkipped (/Users/srodriguez/test_project/node_modules/karma-teamcity-reporter/index.js:84:20)
    at onSpecComplete (/Users/srodriguez/test_project/node_modules/karma/lib/reporters/base.js:76:12)
    at .<anonymous> (/Users/srodriguez/test_project/node_modules/karma/lib/events.js:13:22)
    at emitTwo (events.js:106:13)
    at emit (events.js:191:7)
    at onResult (/Users/srodriguez/test_project/node_modules/karma/lib/browser.js:216:13)
    at Socket.<anonymous> (/Users/srodriguez/test_project/node_modules/karma/lib/events.js:13:22)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:188:7)
    at Socket.onevent (/Users/srodriguez/test_project/node_modules/socket.io/lib/socket.js:335:8)
    at Socket.onpacket (/Users/srodriguez/test_project/node_modules/socket.io/lib/socket.js:295:12)
    at Client.ondecoded (/Users/srodriguez/test_project/node_modules/socket.io/lib/client.js:193:14)
    at Decoder.Emitter.emit (/Users/srodriguez/test_project/node_modules/component-emitter/index.js:134:20)
    at Decoder.add (/Users/srodriguez/test_project/node_modules/socket.io-parser/index.js:247:12)
    at Client.ondata (/Users/srodriguez/test_project/node_modules/socket.io/lib/client.js:175:18)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Socket.onPacket (/Users/srodriguez/test_project/node_modules/engine.io/lib/socket.js:101:14)
    at emitOne (events.js:96:13)
    at WebSocket.emit (events.js:188:7)
    at WebSocket.Transport.onPacket (/Users/srodriguez/test_project/node_modules/engine.io/lib/transport.js:104:8)
sipayRT commented 8 years ago

the same problem with node v4.3

eGavr commented 8 years ago

ping :)

septemptus commented 8 years ago

Same issue on 5.11.1

aallanic commented 8 years ago

What version of karma-teamcity-reporter are you using? Seems some errors were fixed in the latest versions.

jamesots commented 8 years ago

I'm getting this same error, using these versions:

"karma": "1.2.0",
"karma-cli": "1.0.1",
"karma-coverage": "1.1.1",
"karma-jasmine": "0.1.6",
"karma-phantomjs-launcher": "0.1.4",
"karma-teamcity-reporter": "2.0.0"

I'm using node 6.4.0 and CentOS 5.11.

jamesots commented 8 years ago

I found this repo which reproduces the error: https://github.com/vlki/karma-teamcity-reporter-node6-error - however, I had to increase the number of tests in test.js significantly before the error happened on my machine, although with 8000 or so tests it is failing consistently for me.

If I use karma-teamcity-reporter 0.1.2 then the error goes away (this is before writeSync started being used in d8d9e70630031de66036d81b396561fb6de20f70).

yarandoo commented 8 years ago

Same error is reproducing for:

"karma-teamcity-reporter": "1.0.0" node:5.10.1

We have over 2500 tests, and the error happens randomly.

Downgrading to karma-teamcity-reporter 0.1.2 have fixed the issue. (Which is relying in the standard write mechanism from Karma. process.stdout.write)

ilya-g commented 7 years ago

Is it possible to introduce some retry logic in case if EAGAIN is encountered? Something like how readSync is implemented here https://github.com/isaacs/node-graceful-fs/blob/v4.1.11/polyfills.js#L134

sharikovvladislav commented 6 years ago

+1 ping