diff options
| author | Janne Anttila <janne.anttila@digia.com> | 2013-05-30 08:33:18 +0300 |
|---|---|---|
| committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-30 11:01:59 +0200 |
| commit | d01522a052d5a753672442872ea8663a1475e4de (patch) | |
| tree | 88f3b20b9710aa01c02e261a59f34ee62e350b4b /scripts/lib/perl5/QtQA/TestScript.pm | |
| parent | 44c0d64b3be108ad41e2e1fa980d871de1f8b4c8 (diff) | |
Workaround for Windows 8 "Can't spawn cmd.exe" error.
Windows 8 CI builds fail randomly with "Can't spawn cmd.exe" error,
after some investigation it was found that OS environment gets corrupted
on those cases. For more information, please see comments in code.
Since the root cause for environment corruption is not yet known,
workaround implemented by using environment backup/restore mechanism.
With this workaround I managed to run QtQA_master_integration CI in
a loop for 100 times, and without workaround the error typically
happened between 10-20 executions.
Change-Id: I034a3f45a2bd2b791d5beabcd57d8047d1936e68
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
Diffstat (limited to 'scripts/lib/perl5/QtQA/TestScript.pm')
| -rw-r--r-- | scripts/lib/perl5/QtQA/TestScript.pm | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/lib/perl5/QtQA/TestScript.pm b/scripts/lib/perl5/QtQA/TestScript.pm index fc66231d..106f62d1 100644 --- a/scripts/lib/perl5/QtQA/TestScript.pm +++ b/scripts/lib/perl5/QtQA/TestScript.pm @@ -307,6 +307,25 @@ sub _reliable_exe return; } + # TODO: Hack for Windows 8 "Can't spawn cmd.exe" problem. + # + # When command is executed with Qt reliability strategy, + # OS environment is *sporadically* corrupted. The corrupted environment + # contains one new environment variable & value with cryptic (illegal) characters. + # + # The exact line where environment corruption seems to happen most often is: + # https://qt.gitorious.org/qt/qtqa/blobs/master/scripts/lib/perl5/QtQA/Proc/Reliable/Win32.pm#line355 + # Initially I thought it is due to encode_base64, which allows '+', '/' and '=' charachers, + # but switching to URL safe base64 encoding did not solve the problem. + # http://search.cpan.org/~kazuho/MIME-Base64-URLSafe-0.01/lib/MIME/Base64/URLSafe.pm + # + # The broken OS environment causes perl system() command to fail later on. + # + # Because the root cause for environment corruption is not yet known, + # we backup the environment before the reliable command execution, + # and revert the environment back to original after command execcution. + my %ENV_BACKUP = %ENV; + # Whenever we retry the command, log it $proc->retry_cb( sub { $self->_log_exe_retry( @_ ) } ); @@ -314,6 +333,10 @@ sub _reliable_exe my $status = $proc->run( ); $self->_handle_exe_status( $status ); + # TODO: Hack for Windows 8 "Can't spawn cmd.exe" problem. + # Revert environment back to backed-up version. + %ENV = %ENV_BACKUP; + return; } |
