diff -pruN 0.4.1+ds-4/debian/changelog 0.4.1+ds-4ubuntu1/debian/changelog
--- 0.4.1+ds-4/debian/changelog	2022-12-04 16:49:40.000000000 +0000
+++ 0.4.1+ds-4ubuntu1/debian/changelog	2023-03-28 21:19:02.000000000 +0000
@@ -1,3 +1,10 @@
+jsurf-alggeo (0.4.1+ds-4ubuntu1) mantic; urgency=medium
+
+  * d/p/check-interrupted-status.patch: add retries to the test to avoid race
+    condition. (LP: #2013132)
+
+ -- Vladimir Petko <vladimir.petko@canonical.com>  Wed, 29 Mar 2023 10:19:02 +1300
+
 jsurf-alggeo (0.4.1+ds-4) unstable; urgency=medium
 
   * Debianization:
diff -pruN 0.4.1+ds-4/debian/control 0.4.1+ds-4ubuntu1/debian/control
--- 0.4.1+ds-4/debian/control	2022-12-04 15:51:58.000000000 +0000
+++ 0.4.1+ds-4ubuntu1/debian/control	2023-03-28 21:19:02.000000000 +0000
@@ -1,7 +1,8 @@
 Source: jsurf-alggeo
 Section: math
 Priority: optional
-Maintainer: Debian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Debian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
 Uploaders: Jerome Benoit <calculus@rezozer.net>
 Rules-Requires-Root: no
 Build-Depends: debhelper-compat (=13), javahelper, maven-repo-helper, help2man
diff -pruN 0.4.1+ds-4/debian/patches/check-interrupted-status.patch 0.4.1+ds-4ubuntu1/debian/patches/check-interrupted-status.patch
--- 0.4.1+ds-4/debian/patches/check-interrupted-status.patch	1970-01-01 00:00:00.000000000 +0000
+++ 0.4.1+ds-4ubuntu1/debian/patches/check-interrupted-status.patch	2023-03-28 21:19:02.000000000 +0000
@@ -0,0 +1,70 @@
+Description: Resolve test race condition
+ de.mfo.jsurf.test.TestJSurf creates a SwingWorker, waits 100 milliseconds, and
+ attempts to cancel rendering tasks in stopDrawingMethod() and then asserts
+ that the time after swing worker creation has not exceeded 200 msec. This is a
+ flaky assertion that depends on the host machine's performance.
+ Retry interrupts and check interrupted state instead.
+Author: Vladimir Petko <vladimir.petko@canonical.com>
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1032096
+Bug-Ubuntu: https://bugs.launchpad.net/debian/+source/jsurf-alggeo/+bug/2013132
+Forwarded: https://github.com/IMAGINARY/jsurf/pull/12
+Last-Update: 2023-03-29
+--- a/src/test/java/de/mfo/jsurf/test/TestJSurf.java
++++ b/src/test/java/de/mfo/jsurf/test/TestJSurf.java
+@@ -8,6 +8,10 @@
+ import de.mfo.jsurf.parser.*;
+ import de.mfo.jsurf.util.FileFormat;
+ import java.util.Properties;
++import java.util.concurrent.TimeoutException;
++import java.util.concurrent.ExecutionException;
++import java.util.concurrent.TimeUnit;
++
+ import javax.swing.SwingWorker;
+ 
+ public class TestJSurf
+@@ -27,6 +31,8 @@
+ 
+ 		class BackgroundRenderer extends SwingWorker< Void, Void >
+ 		{
++			public boolean interrupted = false;
++
+ 		   @Override
+ 		   public Void doInBackground() {
+ 		   		try {
+@@ -35,6 +41,7 @@
+ 		   		catch( RenderingInterruptedException rie )
+ 		   		{
+ 		   			System.out.println( "Rendering interrupted" );
++					interrupted = true;
+ 		   		}
+ 		    	return null;
+ 		   }
+@@ -45,16 +52,23 @@
+ 		br.execute();
+ 
+     	long t = System.currentTimeMillis();
+-    	Thread.sleep( 100 );
+-
+ 		System.out.println( "Attempting to stop rendering" );
+-    	asr.stopDrawing();
++		for (int i = 0; i < 100; ) {
++			try
++			{
++				asr.stopDrawing();
++				br.get(100, TimeUnit.MILLISECONDS);
++				break;
++			}
++			catch (InterruptedException e) {}
++			catch (ExecutionException e) {}
++			catch (TimeoutException e) {}
++		}
+ 
+-    	br.get();
+     	t = System.currentTimeMillis() - t;
+     	System.out.println( "Render method finished after " + t + "ms" );
+ 
+-		Assert.assertTrue( "stopDrawing must interrupt and stop the rendering process", t < 200 );
++		Assert.assertTrue( "stopDrawing must interrupt and stop the rendering process", br.interrupted );
+ 	}
+ 
+ 	@Test
diff -pruN 0.4.1+ds-4/debian/patches/series 0.4.1+ds-4ubuntu1/debian/patches/series
--- 0.4.1+ds-4/debian/patches/series	2018-06-06 03:51:01.000000000 +0000
+++ 0.4.1+ds-4ubuntu1/debian/patches/series	2023-03-28 21:19:02.000000000 +0000
@@ -1,3 +1,4 @@
 debianization.patch
 add-generated-java-files.patch
 debianization-documentation.patch
+check-interrupted-status.patch
