diff --git a/src/test/regress/expected/interval.out b/src/test/regress/expected/interval.out
index 99fd0ca4900c8208f66fff236ec77ef1ed3d26a7..a62e85fafecefe4e6b12a7908f8101df918b40af 100644
--- a/src/test/regress/expected/interval.out
+++ b/src/test/regress/expected/interval.out
@@ -307,10 +307,13 @@ select '4 millenniums 5 centuries 4 decades 1 year 4 months 4 days 17 minutes 31
 (1 row)
 
 -- test long interval output
-select '100000000y 10mon -1000000000d -1000000000h -10min -10.000001s ago'::interval;
-                                         interval                                          
--------------------------------------------------------------------------------------------
- @ 100000000 years 10 mons -1000000000 days -1000000000 hours -10 mins -10.000001 secs ago
+-- Note: the actual maximum length of the interval output is longer,
+-- but we need the test to work for both integer and floating-point
+-- timestamps.
+select '100000000y 10mon -1000000000d -100000h -10min -10.000001s ago'::interval;
+                                       interval                                        
+---------------------------------------------------------------------------------------
+ @ 100000000 years 10 mons -1000000000 days -100000 hours -10 mins -10.000001 secs ago
 (1 row)
 
 -- test justify_hours() and justify_days()
diff --git a/src/test/regress/sql/interval.sql b/src/test/regress/sql/interval.sql
index 7cee2864def15f0619319ce8de5e30b81f093e85..78ce9f7bc93cbd857ef478b0ed697a3baf22844c 100644
--- a/src/test/regress/sql/interval.sql
+++ b/src/test/regress/sql/interval.sql
@@ -109,7 +109,10 @@ select avg(f1) from interval_tbl;
 select '4 millenniums 5 centuries 4 decades 1 year 4 months 4 days 17 minutes 31 seconds'::interval;
 
 -- test long interval output
-select '100000000y 10mon -1000000000d -1000000000h -10min -10.000001s ago'::interval;
+-- Note: the actual maximum length of the interval output is longer,
+-- but we need the test to work for both integer and floating-point
+-- timestamps.
+select '100000000y 10mon -1000000000d -100000h -10min -10.000001s ago'::interval;
 
 -- test justify_hours() and justify_days()