electron-userland / spectron

DEPRECATED: 🔎 Test Electron apps using ChromeDriver
http://electronjs.org/spectron
MIT License
1.68k stars 229 forks source link

test suddenly failing on Github Action Windows #1037

Open jeffcrouse opened 2 years ago

jeffcrouse commented 2 years ago

I am building my electron app with action-electron-builder via a Github Action and for almost a year it's been working fine.

Suddenly, this week, the super-basic spectron sanity test that I run before building has started failing about 75-80% of the time on Windows. In other words, I just keep running it until it passes, and usually it takes 4-5 attempts. The app (and the test) run fine locally.

It still passes on Mac like it always has.

The Test

describe('Deploy Test', function () {
    this.timeout(20000);

    // --------------------------------------------------------------------------
    before(function () {
        this.app = new Application({
            path: electronPath,
            args: [path.join(__dirname, '..')]
        })

        return this.app.start();
    }) /* end before() */

    // --------------------------------------------------------------------------
    it('shows an initial window', function () {
        return this.app.client.getWindowCount().then((count) => {
            count.should.equal(1);
        });
    })

    // --------------------------------------------------------------------------
    after(function () {
        if (this.app && this.app.isRunning()) {
            return this.app.stop()
        }
    })
})

The error message:

  1) Deploy Test
       "before all" hook for "shows an initial window":
     Error: Timeout of 20000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (D:\a\citizen-browser-app\citizen-browser-app\test\deploy.js)
      at listOnTimeout (internal/timers.js:557:17)
      at processTimers (internal/timers.js:500:7)

I'm using electron 13.0.1 and spectron 15.0.0.

All signs point to this being something that changed on the Github side, but I was hoping to get some hints about what it might be here so that I know what to look for.

Thanks in advance!