Skip to content

[🐛 Bug]: Overriding specFileRetries from beforeSession #14842

@bgrozev

Description

@bgrozev

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

9.20.0

Node.js Version

23.11.0

Mode

Standalone Mode

Which capabilities are you using?

capabilities: [{
        browserName: 'chrome',
        'goog:chromeOptions': {
            args: ['--headless', '--disable-gpu', '--disable-dev-shm-usage']
        }
    }],

What happened?

When the specFileRetries config property is overriden inside a beforeSession hook, the new value does not take effect.

What is your expected behavior?

When the specFileRetries config property is overriden to 1 inside a beforeSession hook, and a spec file fails, it should be retried.

How to reproduce the bug.

This repo contains a minimal example:
https://github.com/bgrozev/wdio-specFileRetries-beforeSession

Running with npm test fails to retry the failing test.

Note that the same problem was reported for 6.1.17 and reportedly fixed in some later version, but 9.20.0 and 9.16.0 have the problem.

Relevant log output

Spec Files:	 0 passed, 1 failed, 1 total (100% completed) in 00:00:05

Compare with the same test when specFileRetries is set to 1 in the wdio.conf.js directly:

Spec Files:	 0 passed, 1 retries, 1 failed, 1 total (100% completed) in 00:00:07

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug 🐛help wantedIssues that are free to take by anyone interested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions