diff mbox series

[OSSTEST,11/11] mg-allocate: Don't try allocating the same resource for two specs

Message ID 20190503165957.5960-12-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show
Series mg-repro-flight: Provide --rebuild to make variant build jobs too | expand

Commit Message

Ian Jackson May 3, 2019, 4:59 p.m. UTC
This is obviously wrong.  In fact it does not work (we bomb out in the
allocation).

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
v2: New patch
---
 mg-allocate | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/mg-allocate b/mg-allocate
index 087b14b0..b5dc185e 100755
--- a/mg-allocate
+++ b/mg-allocate
@@ -437,6 +437,16 @@  sub plan () {
 		map { [ @$possreqs, $_ ] } @reqlist;
 	    } @possmatrix;
         }
+        @possmatrix = grep {
+            my $possreqs = $_;
+            my %got;
+            my $ok=1;
+            foreach (@$possreqs) {
+                next if !$got{$_->{Reso}}++;
+                $ok=0; last;
+            }
+            $ok;
+        } @possmatrix;
 
 	my $planned;
 	my @reqlist;