()
| 13 | |
| 14 | |
| 15 | def tutorial_timeout(): |
| 16 | pipeline = GPipeline() |
| 17 | a, b, c, d = MyNode1(), MyNode2(), MyNode1(), MyNode1() |
| 18 | |
| 19 | pipeline.registerGElement(a, set(), "nodeA") |
| 20 | pipeline.registerGElement(b, {a}, "nodeB") |
| 21 | pipeline.registerGElement(c, {a}, "nodeC") |
| 22 | pipeline.registerGElement(d, {b, c}, "nodeD") |
| 23 | |
| 24 | status: CStatus = pipeline.process() |
| 25 | if status.isOK(): |
| 26 | print("---- T22-timeout.py pipeline run finish \n") |
| 27 | |
| 28 | c.setTimeout(300) |
| 29 | print("---- set [{0}] timeout value to 300".format(c.getName())) |
| 30 | status = pipeline.process() |
| 31 | if not status.isOK(): |
| 32 | print("---- T22-timeout pipeline run error info : {0} \n".format(status.getInfo())) |
| 33 | |
| 34 | c.setTimeout(0) |
| 35 | print("---- set [{0}] no timeout, rerun pipeline again".format(c.getName())) |
| 36 | status = pipeline.process() |
| 37 | if status.isOK(): |
| 38 | print("---- T22-timeout.py pipeline run finish again") |
| 39 | |
| 40 | |
| 41 | if __name__ == '__main__': |
no test coverage detected