@@ -623,9 +623,17 @@ describe('Testing views plugin', function() {
623623 if ( err ) {
624624 console . log ( err ) ;
625625 }
626- setTimeout ( done , 1000 * testUtils . testScalingFactor ) ;
626+ setTimeout ( done , 500 * testUtils . testScalingFactor + 2000 ) ;
627627 } ) ;
628628 } ) ;
629+ it ( 'Trigger deletion job to run to clean out data completely from granular data' , function ( done ) {
630+ testUtils . triggerJobToRun ( "api:deletionManagerJob" , function ( error ) {
631+ if ( error ) {
632+ console . log ( error ) ;
633+ }
634+ setTimeout ( done , 500 * testUtils . testScalingFactor + 2000 ) ;
635+ } ) ;
636+ } ) ;
629637 verifyTotals ( "30days" ) ;
630638 } ) ;
631639
@@ -996,11 +1004,7 @@ describe('Testing views plugin', function() {
9961004 setTimeout ( done , 100 * testUtils . testScalingFactor + waitTime ) ;
9971005 } ) ;
9981006 } ) ;
999- it ( "wait" , function ( done ) {
1000- setTimeout ( done , 30000 ) ;
1001- } ) ;
10021007 verifyTotals ( "30days" ) ;
1003-
10041008 it ( "End the first view(should not flush yet)" , function ( done ) {
10051009 var data = JSON . stringify ( [ { "key" : "[CLY]_view" , "count" : 1 , "dur" : 100 , "segmentation" : { "name" : "testviewFirst" } } ] ) ;
10061010 request
@@ -1046,14 +1050,8 @@ describe('Testing views plugin', function() {
10461050 verifyTotals ( "30days" ) ;
10471051 } ) ;
10481052
1049- describe ( "wait" , function ( ) {
1050- it ( "waiting some time for db to settle" , function ( done ) {
1051- setTimeout ( done , 30000 ) ;
1052- } ) ;
1053- } ) ;
1054-
10551053 describe ( 'reset app' , function ( ) {
1056- it ( 'should reset data ' , function ( done ) {
1054+ it ( 'trigger reset endpoint ' , function ( done ) {
10571055 var params = { app_id : APP_ID , "period" : "reset" } ;
10581056 request
10591057 . get ( '/i/apps/reset?api_key=' + API_KEY_ADMIN + "&args=" + JSON . stringify ( params ) )
@@ -1067,6 +1065,11 @@ describe('Testing views plugin', function() {
10671065 setTimeout ( done , 500 * testUtils . testScalingFactor ) ;
10681066 } ) ;
10691067 } ) ;
1068+ it ( 'Trigger deletion job to run' , function ( done ) {
1069+ testUtils . triggerJobToRun ( "api:deletionManagerJob" , function ( ) {
1070+ setTimeout ( done , 500 * testUtils . testScalingFactor ) ;
1071+ } ) ;
1072+ } ) ;
10701073 } ) ;
10711074
10721075 describe ( 'verify empty views tables' , function ( ) {
@@ -1431,7 +1434,7 @@ describe('Testing views plugin', function() {
14311434 } ) ;
14321435
14331436 describe ( 'reset app' , function ( ) {
1434- it ( 'should reset data ' , function ( done ) {
1437+ it ( 'trigger reset endpoint ' , function ( done ) {
14351438 var params = { app_id : APP_ID , "period" : "reset" } ;
14361439 request
14371440 . get ( '/i/apps/reset?api_key=' + API_KEY_ADMIN + "&args=" + JSON . stringify ( params ) )
@@ -1442,9 +1445,14 @@ describe('Testing views plugin', function() {
14421445 }
14431446 var ob = JSON . parse ( res . text ) ;
14441447 ob . should . have . property ( 'result' , 'Success' ) ;
1445- setTimeout ( done , 500 * testUtils . testScalingFactor + 2000 ) ;
1448+ setTimeout ( done , 500 * testUtils . testScalingFactor ) ;
14461449 } ) ;
14471450 } ) ;
1451+ it ( 'Trigger deletion job to run' , function ( done ) {
1452+ testUtils . triggerJobToRun ( "api:deletionManagerJob" , function ( ) {
1453+ setTimeout ( done , 500 * testUtils . testScalingFactor ) ;
1454+ } ) ;
1455+ } ) ;
14481456 } ) ;
14491457
14501458 describe ( 'verify empty views tables' , function ( ) {
0 commit comments