From e8ca5ee55f501d79dbc16fc5720e9d051be57aa6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com>
Date: Thu, 27 Aug 2015 18:03:50 +0200
Subject: Prevent from races by using free display numbers


diff --git a/Test-NeedsDisplay-1.07-Use-non-conflicting-display-numbers.patch 
b/Test-NeedsDisplay-1.07-Use-non-conflicting-display-numbers.patch
new file mode 100644
index 0000000..5176e2f
--- /dev/null
+++ b/Test-NeedsDisplay-1.07-Use-non-conflicting-display-numbers.patch
@@ -0,0 +1,33 @@
+From 1b3f53f50706d2cb12651e30bfee3cf326e5e07c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com>
+Date: Thu, 27 Aug 2015 17:47:37 +0200
+Subject: [PATCH] Use non-conflicting display numbers
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+xfvb-run insists on :99 display. It prevents from running multiple
+Test::NeedsDisplay in parallel.
+
+This patch instructs xvfb-run to use a free display number.
+
+It also prevents from random failures I noticed in
+<https://bugzilla.redhat.com/show_bug.cgi?id=1248968>.
+
+Signed-off-by: Petr Písař <ppi...@redhat.com>
+
+diff --git a/lib/Test/NeedsDisplay.pm b/lib/Test/NeedsDisplay.pm
+index 6ff8448..275e6d8 100644
+--- a/lib/Test/NeedsDisplay.pm
++++ b/lib/Test/NeedsDisplay.pm
+@@ -107,6 +107,7 @@ sub import {
+               print "# Restarting with xvfb-run...\n";
+               exec(
+                       $xvfb_run,
++            '-a',
+                       $^X,
+                       ($INC{'blib.pm'} ? '-Mblib' : ()),
+                       ($INC{'perl5db.pl'} ? '-d' : ()),
+-- 
+2.4.3
+
diff --git a/perl-Test-NeedsDisplay.spec b/perl-Test-NeedsDisplay.spec
index a83d86c..d59882e 100644
--- a/perl-Test-NeedsDisplay.spec
+++ b/perl-Test-NeedsDisplay.spec
@@ -1,11 +1,14 @@
 Name:           perl-Test-NeedsDisplay
 Version:        1.07
-Release:        12%{?dist}
+Release:        13%{?dist}
 Summary:        Ensure that tests needing a display have one
 License:        GPL+ or Artistic
 Group:          Development/Libraries
 URL:            http://search.cpan.org/dist/Test-NeedsDisplay/
 Source0:        
http://www.cpan.org/authors/id/A/AD/ADAMK/Test-NeedsDisplay-%{version}.tar.gz
+# Prevent from races by using free display numbers, bug #1248968,
+# CPAN RT#106699
+Patch0:         
Test-NeedsDisplay-1.07-Use-non-conflicting-display-numbers.patch
 BuildArch:      noarch
 BuildRequires:  coreutils
 BuildRequires:  findutils
@@ -47,6 +50,7 @@ any objects.
 
 %prep
 %setup -q -n Test-NeedsDisplay-%{version}
+%patch0 -p1
 # Remove bundled modules
 rm -rf ./inc
 sed -i -e '/^inc\//d' MANIFEST
@@ -70,6 +74,9 @@ make test
 %{_mandir}/man3/*
 
 %changelog
+* Thu Aug 27 2015 Petr Pisar <ppi...@redhat.com> - 1.07-13
+- Prevent from races by using free display numbers (bug #1248968)
+
 * Fri Jul 31 2015 Petr Pisar <ppi...@redhat.com> - 1.07-12
 - Specify all dependencies
 
-- 
cgit v0.10.2


        
http://pkgs.fedoraproject.org/cgit/perl-Test-NeedsDisplay.git/commit/?h=master&id=e8ca5ee55f501d79dbc16fc5720e9d051be57aa6
--
Fedora Extras Perl SIG
http://www.fedoraproject.org/wiki/Extras/SIGs/Perl
perl-devel mailing list
perl-devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/perl-devel

Reply via email to