[test] close jdbc and client after each test#2438
[test] close jdbc and client after each test#2438ruanhang1993 merged 4 commits intoapache:masterfrom
Conversation
yuxiqian
left a comment
There was a problem hiding this comment.
Thanks @loserwang1024, I left some comments.
| assertEqualsInAnyOrder( | ||
| Arrays.asList(binlogExpected), fetchRows(iterator, binlogExpected.length)); | ||
| result.getJobClient().ifPresent(client -> client.cancel()); | ||
| result.getJobClient().get().cancel().get(); |
There was a problem hiding this comment.
Occasionally Db2 ITCase will fail because of trying to cancel a job which isn't running (#2345). Will same thing happen here?
There was a problem hiding this comment.
Thanks for your advice, @yuxiqian . As an unbounded streaming job, this job should not stop before can it.
To be honest, I am a little confused that in db2 ItCase, why you skip job when a job isn't running. Does it a bounded job? If not, isn't it a wrong bahavior?
de51f24 to
67266ea
Compare
|
@yuxiqian , CC. I have modified it |
| assertFalse(state.contains("server_id")); | ||
| assertFalse(state.contains("event")); | ||
|
|
||
| source.cancel(); |
There was a problem hiding this comment.
We could add a new method to help to close DebeziumSourceFunction right.
There was a problem hiding this comment.
I have noticed that source.close contains source.cancel, so I remove all the source.cancel before source.close
45666b4 to
409dede
Compare
409dede to
300b000
Compare
In mysql and postgres test unit, the connections to database and Flink cluster are not closed after test.
This connections may influence other test unit.