Protractor: webdriver-manager stdout maxBuffer exceed

Created on 7 May 2014  ·  3Comments  ·  Source: angular/protractor

Hello all

I'm using Protractor and webdriver-manager start in a single grunt task, since in ci i cannot use 2 terminal windows.

Specs : Windows 7, node v0.10.26, Protractor 0.22.0, grunt protractor runner (Which uses Protractor 0.22.0)

I am using grunt concurrent with 2 tasks - grunt shell webdriver-manager start and protractor. Running the tests one by one they always succeed. Running all the tests,
the first tests succedd, but at the 4th or 5th test it fails with this message .....Warning: stdout maxBuffer exceeded. Use --force to continue.
It appears spawn command buffer limit is exceed and the child task exits.

I have solved this issue by changing webdriver-manager spawn command.

in Webdriver-manager i changed
return childProcess.spawn(winCommand, finalArgs,
{ stdio: 'inherit' });

to:
return childProcess.spawn(winCommand, finalArgs,
{ stdio: 'ignore' });

Is there any other solution for webdriver-manager not to exceed the buffer, or can this be configurable? Can the feature to disable spawn logging be included in a future release of Protractor.

Most helpful comment

Sorry for the slow response. I'm pretty sure that this error is because grunt shell is using Node's child_process.exec command. This allows for a custom maxBuffer option, which you should increase. You can do this like:

grunt.initConfig({
    shell: {
        foo: {
            command: 'webdriver-manager start',
            options: {
                stderr: false,
                execOptions: {
                    maxBuffer: 400*1024 // or whatever other large value you want
                }
            }
        }
    }
});

Closing as this is a grunt issue.

All 3 comments

Sorry for the slow response. I feel like this is an issue with grunt - all webdriver-manager is doing is forwarding the output. I'm not particularly familiar with how grunt handles output, but maybe you can tell grunt to ignore stdout?

Hello Julie
With no success i was able to ignore stdout from the child process in webdriver-manager. Although in the grunt task output, no logs appeared, after some tests the same error message appeared 'stdout maxBuffer exceeded'. I was only able to circumvent the issue by running a grunt replace task to change the stdio in webdriver manager.

Sorry for the slow response. I'm pretty sure that this error is because grunt shell is using Node's child_process.exec command. This allows for a custom maxBuffer option, which you should increase. You can do this like:

grunt.initConfig({
    shell: {
        foo: {
            command: 'webdriver-manager start',
            options: {
                stderr: false,
                execOptions: {
                    maxBuffer: 400*1024 // or whatever other large value you want
                }
            }
        }
    }
});

Closing as this is a grunt issue.

Was this page helpful?
0 / 5 - 0 ratings