From 05d3e640cd6142409820207195d7819e04ad0479 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 4 May 2017 14:48:18 -0500 Subject: [PATCH] Testing msi: Add retries if necessary Hoping this will fix the annoying problems on Windows Jenkins. --- src/ioc/dbtemplate/test/msi.plt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/ioc/dbtemplate/test/msi.plt b/src/ioc/dbtemplate/test/msi.plt index f584dcf3d..230a2c18b 100644 --- a/src/ioc/dbtemplate/test/msi.plt +++ b/src/ioc/dbtemplate/test/msi.plt @@ -58,5 +58,19 @@ sub msi { my ($args) = @_; my $exe = ($^O eq 'MSWin32') || ($^O eq 'cygwin') ? '.exe' : ''; my $msi = "./msi-copy$exe"; - return `$msi $args`; + my $result; + if ($args =~ m/-o / && $args !~ m/-D/) { + # An empty result is expected + $result = `$msi $args`; + } + else { + # Try up to 5 times, sometimes msi fails on Windows + my $count = 5; + do { + $result = `$msi $args`; + print "# result of '$msi $args' empty, retrying\n" + if $result eq ''; + } while ($result eq '') && (--$count > 0); + } + return $result; }