This paper presents a new approach, called NodeRacer, that detects event races in Node.js applications by selectively postponing events, guided by happens-before relations. The technique is implemented entirely with code instrumentation, without modifications of the Node.js system. Our experimental results give evidence that NodeRacer finds event race errors with higher probability than a state-of-the-art fuzzer, and that the use of happens-before relations helps avoiding false positives. Furthermore, we demonstrate that NodeRacer produces actionable error reports, and that it can be helpful for detecting test flakiness that is caused by event races.
[ PDF | BibTeX | supplementary material ]