tweag / funflow

Functional workflows

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is `interrupt-worker` a franken-test ?

rbonichon opened this issue · comments

The interrupt worker test is behaving weirdly to say the least.

    sleepEcho = external $ \(time, msg) -> ExternalTask
      { _etCommand = "sh"
      , _etWriteToStdOut = StdOutCapture
      , _etParams =
          [  "-c"
          , "sleep " <> fromString (show time) <> "; "
            <> "echo -n " <> fromString msg
          ]
      , _etEnv = EnvExplicit []
      }
  1. When running stack test, this test usually fails (on my laptop) and - also - sometimes passes.
  2. In any event, sleep is never found. Any idea as to what might be causing the trouble here ?

Here are two different outcomes for the same test.

Good test

      interrupt worker:                                       [2019-09-17 13:18:39][FFExecutorD.executeLoop][Info][oxum][PID 23277][ThreadId 1][funflow-1.4.1-CjNqbdUqZ513xPmSOvJOl9:Control.Funflow.External.Executor src/Control/Funflow/External/Executor.hs:181:9] Initialising connection to coordinator.
    [2019-09-17 13:18:41][FFExecutorD.executeLoop][Info][oxum][PID 23465][ThreadId 1][funflow-1.4.1-CjNqbdUqZ513xPmSOvJOl9:Control.Funflow.External.Executor src/Control/Funflow/External/Executor.hs:181:9] Initialising connection to coordinator.
    [2019-09-17 13:18:41][FFExecutorD.executeLoop.process][Info][oxum][PID 23465][ThreadId 1][processId:CreateProcess {cmdspec = RawCommand "sh" ["-c","sleep 1.0s;echo -n test"], cwd = Just "/run/user/1000/funflow_sqlite_-e91cbd08cb505b82/store/pending-4bbef67229b93fd9402da09599b4ef8858cfd2add992ecc00c66745c209f4d40/", env = Just [], std_in = Inherit, std_out = UseHandle {handle: /run/user/1000/funflow_sqlite_-e91cbd08cb505b82/store/metadata/hash-4bbef67229b93fd9402da09599b4ef8858cfd2add992ecc00c66745c209f4d40/stdout}, std_err = UseHandle {handle: /run/user/1000/funflow_sqlite_-e91cbd08cb505b82/store/metadata/hash-4bbef67229b93fd9402da09599b4ef8858cfd2add992ecc00c66745c209f4d40/stderr}, close_fds = True, create_group = False, delegate_ctlc = False, detach_console = False, create_new_console = False, new_session = False, child_group = Nothing, child_user =
    Nothing, use_process_jobs = False}][task:4bbef67229b93fd9402da09599b4ef8858cfd2add992ecc00c66745c209f4d40][funflow-1.4.1-CjNqbdUqZ513xPmSOvJOl9:Control.Funflow.External.Executor src/Control/Funflow/External/Executor.hs:125:9] Executing
    sh: sleep: command not found
    test[2019-09-17 13:18:41][FFExecutorD.executeLoop][Info][oxum][PID 23465][ThreadId 1][task:4bbef67229b93fd9402da09599b4ef8858cfd2add992ecc00c66745c209f4d40][funflow-1.4.1-CjNqbdUqZ513xPmSOvJOl9:Control.Funflow.External.Executor src/Control/Funflow/External/Executor.hs:206:19] Task completed successfully
    OK (3.10s)

Bad test

    interrupt worker:                                       [2019-09-17 13:26:29][FFExecutorD.executeLoo
    p][Info][oxum][PID 7488][ThreadId 1][funflow-1.4.1-CjNqbdUqZ513xPmSOvJOl9:Control.Funflow.External.Executor
    src/Control/Funflow/External/Executor.hs:181:9] Initialising connection to coordinator.
        [2019-09-17 13:26:29][FFExecutorD.executeLoop.process][Info][oxum][PID 7488][ThreadId 1][processId:CreateProcess {cmdspec = RawCommand "sh" ["-c","sleep 1.0;echo -n test"], cwd = Just "/run/user/1000/funflow_sqlite_-4c4bd6c2426b3f57/store/pending-13761f32d566f68e61a9685fccb445b13bcd4f91553302af7455bb0cf6ecfd16/", env = Just [], std_in = Inherit, std_out = UseHandle {handle: /run/user/1000/funflow_sqlite_-4c4bd6c2426b3f57/store/metadata/hash-13761f32d566f68e61a9685fccb445b13bcd4f91553302af7455bb0cf6ecfd16/stdout}, std_err = UseHandle {handle: /run/user/1000/funflow_sqlite_-4c4bd6c2426b3f57/store/metadata/hash-13761f32d566f68e61a9685fccb445b13bcd4f91553302af7455bb0cf6ecfd16/stderr}, close_fds = True, create_group = False, delegate_ctlc = False, detach_console = False, create_new_console = False, new_session = False, child_group = Nothing, child_user
    = Nothing, use_process_jobs = False}][task:13761f32d566f68e61a9685fccb445b13bcd4f91553302af7455bb0cf6ecfd16][funflow-1.4.1-CjNqbdUqZ513xPmSOvJOl9:Control.Funflow.External.Executor src/Control/Funflow/External/Executor.hs:125:9] Executing
        testsh: sleep: command not found
        [2019-09-17 13:26:29][FFExecutorD.executeLoop][Info][oxum][PID 7488][ThreadId 1][task:13761f32d566f68e61a9685fccb445b13bcd4f91553302af7455bb0cf6ecfd16][funflow-1.4.1-CjNqbdUqZ513xPmSOvJOl9:Control.Funflow.External.Executor src/Control/Funflow/External/Executor.hs:206:19] Task completed successfully
        FAIL (2.55s)
              test/Funflow/SQLiteCoordinator.hs:136:
              Executor should not have completed the task

Closing this issue since external-executor is no longer used in funflow2.x