@@ -37,8 +37,7 @@ export default function ruleTests({ getService }: FtrProviderContext) {
37
37
createEsDocumentsInGroups,
38
38
} = getRuleServices ( getService ) ;
39
39
40
- // Failing: See https://github.com/elastic/kibana/issues/143870
41
- describe . skip ( 'rule' , async ( ) => {
40
+ describe ( 'rule' , async ( ) => {
42
41
let endDate : string ;
43
42
let connectorId : string ;
44
43
const objectRemover = new ObjectRemover ( supertest ) ;
@@ -221,6 +220,8 @@ export default function ruleTests({ getService }: FtrProviderContext) {
221
220
] . forEach ( ( [ searchType , initData ] ) =>
222
221
it ( `runs correctly: use epoch millis - threshold on hit count < > for ${ searchType } search type` , async ( ) => {
223
222
// write documents from now to the future end date in groups
223
+ const endDateMillis = Date . now ( ) + ( RULE_INTERVALS_TO_WRITE - 1 ) * RULE_INTERVAL_MILLIS ;
224
+ endDate = new Date ( endDateMillis ) . toISOString ( ) ;
224
225
await createEsDocumentsInGroups ( ES_GROUPS_TO_WRITE , endDate ) ;
225
226
await initData ( ) ;
226
227
@@ -239,7 +240,7 @@ export default function ruleTests({ getService }: FtrProviderContext) {
239
240
240
241
// during the first execution, the latestTimestamp value should be empty
241
242
// since this rule always fires, the latestTimestamp value should be updated each execution
242
- if ( ! i ) {
243
+ if ( i === 0 ) {
243
244
expect ( previousTimestamp ) . to . be . empty ( ) ;
244
245
} else {
245
246
expect ( previousTimestamp ) . not . to . be . empty ( ) ;
0 commit comments