Skip to content

Commit

Permalink
fix(flaky-test): Add time to beforeEach() to allow plugins to load on…
Browse files Browse the repository at this point in the history
… first pass. (#3025)

Loading plugins in beforeEach seems unwise: the it() blocks potentially run against different environments. In particular the first it() block runs with the timer already worn down by the plugin load and often the timeout hits on my mac air before the test passes.Until we can restructure this code a longer timeout avoids flaky tests.
  • Loading branch information
johnjbarton committed Jun 4, 2018
1 parent bc9acd3 commit 31d9a08
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/unit/server.spec.js
Expand Up @@ -17,7 +17,10 @@ describe('server', () => {
var fileListOnResolve = fileListOnReject = mockLauncher = null
var mockFileList = mockWebServer = mockSocketServer = mockExecutor = doneSpy = null

beforeEach(() => {
// Use regular function not arrow so 'this' is mocha 'this'.
beforeEach(function () {
// The first call to new Server() loads plugins and it can take >2000ms.
this.timeout(4000)
browserCollection = new BrowserCollection()
doneSpy = sinon.spy()

Expand Down

0 comments on commit 31d9a08

Please sign in to comment.