Pārlūkot izejas kodu

Merge pull request #14520 from ghalliday/issue25204

HPCC-25204 Fix occasional failures from schedule1.ecl running smoketest

Reviewed-By: Attila Vamos <attila.vamos@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 4 gadi atpakaļ
vecāks
revīzija
9c21308eff
1 mainītis faili ar 17 papildinājumiem un 2 dzēšanām
  1. 17 2
      testing/regress/ecl/schedule1.ecl

+ 17 - 2
testing/regress/ecl/schedule1.ecl

@@ -17,9 +17,24 @@
 
 //nothor
 
+//This is a obscure test for the event generation and processing capabilities of the workflow engine.
+
+//If two instances of this query are run at the same time it can cause problems.  Both will generate an
+//event, but the event from one workunit will be sent to both workunits.  The respoonse in stage 2 is
+//coded to be sent back to the workunit that generated it.  This means the 1st workunit receives two result
+//events, and the 2nd workunit receives none.
+
+//Ideally there would be a filter on the event that would allow an event from a different workunit to be
+//rejected.
+
+//To avoid problems in the regression suite (when roxie and hthor are run at the same time) use an
+//event name that is based on the target platform.
+
+myEventName := 'TestScheduleEvent' + __TARGET_PLATFORM__;
+
 sequential(
         output('Line1');
-        notify(EVENT('TestScheduleEvent', '<Event><name>Gavin</name><action>check</action><from>' + WORKUNIT + '</from></Event>'));
+        notify(EVENT(myEventName, '<Event><name>Gavin</name><action>check</action><from>' + WORKUNIT + '</from></Event>'));
         output('Line2')
 ) : when(cron('* * * * *'),count(1));
 
@@ -29,7 +44,7 @@ sequential(
         output('Perform ' + EVENTEXTRA('action') + ' for ' + EVENTEXTRA('name'));
         notify(EVENT('TestScheduleResult', '<Event><name>' + EVENTEXTRA('name') + '</name><result>ok</result></Event>'), EVENTEXTRA('from'));
         output('Line4')
-) : when('TestScheduleEvent', count(1));
+) : when(myEventName, count(1));
 
 sequential(
         output('Line5');