@@ -1367,16 +1367,25 @@ def testFilteringRangeInterval(self):
13671367
13681368 def testFilteringRangeGeekInterval (self ):
13691369 ae , filter , filter_iter = self .filteringSetup ()
1370+ # Note: When querying, create date one minute later than the
1371+ # timespan later queried to avoid race conditions where the
1372+ # creation of the deadline is more than a second ago when
1373+ # queried -- in that case we wouldn't get the expected result.
1374+ # By extending the interval by a minute we would need a very
1375+ # slow machine for this test to fail :-)
13701376 for issue in (
1371- { 'deadline' : date .Date ('. -2d' )},
1372- { 'deadline' : date .Date ('. -1d' )},
1373- { 'deadline' : date .Date ('. -8d' )},
1377+ { 'deadline' : date .Date ('. -2d' ) + date . Interval ( '00:01' ) },
1378+ { 'deadline' : date .Date ('. -1d' ) + date . Interval ( '00:01' ) },
1379+ { 'deadline' : date .Date ('. -8d' ) + date . Interval ( '00:01' ) },
13741380 ):
13751381 self .db .issue .create (** issue )
13761382 for filt in filter , filter_iter :
13771383 ae (filt (None , {'deadline' : '-2d;' }), ['5' , '6' ])
13781384 ae (filt (None , {'deadline' : '-1d;' }), ['6' ])
13791385 ae (filt (None , {'deadline' : '-1w;' }), ['5' , '6' ])
1386+ ae (filt (None , {'deadline' : '. -2d;' }), ['5' , '6' ])
1387+ ae (filt (None , {'deadline' : '. -1d;' }), ['6' ])
1388+ ae (filt (None , {'deadline' : '. -1w;' }), ['5' , '6' ])
13801389
13811390 def testFilteringIntervalSort (self ):
13821391 # 1: '1:10'
0 commit comments