-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BkTimetable wrong design #211
Comments
@davvd assign @dmzaytsev to this task pls |
@yegor256 should I use Thread instance instead ScheduledExecutorService ? something like this
|
@yegor256 I will find a developer for the task soon... |
@yegor256 milestone set to |
@yegor256 thanks a lot for reporting, 15 mins added to your acc, pmt ID |
@yegor256 OK @dmzaytsev please go ahead, this task is yours |
@dmzaytsev yes, that's how I would do this, with |
@yegor256 We have some problems when using BkTimeable with BkParallel. BkTimeable catches the current thread, but BkParallel creates a new thread which unknown for BkTimeable. We need to change call order for them. Also I suggest to break BkTimeable into two classes Watcher and BkTimeable.
This will allow to use the single watcher for the whole application if we have several listeners. |
rewritten the unit test
@dmzaytsev I didn't get the idea of watcher... why do we need to make it visible/changeable outside of |
@yegor256 Idea of watcher is sharing one watcher between many thread catchers. In case if we use multiple instances of Front(listen different ports). But this is rare case. I think it is not required. |
@dmzaytsev yes, it's over-engineering. let's keep it simple |
@dmzaytsev looks perfect now, thanks! |
@yegor256 you are welcome :) |
@elenavolokhova please, let us know what do you think about this ticket, according to our QA rules |
@davvd Quality is good. |
@elenavolokhova thanks for the review |
@elenavolokhova thank you, good quality is always good :) |
@dmzaytsev I added 10 mins to @elenavolokhova (for QA review) in transaction 56854433 Thanks a lot, I just topped your account for 30 mins, transaction ID +30 added to your rating, at the moment it is: +1212 |
I think that current design of
BkTimetable
is too complex, that's why the unit test is very difficult to understand. I would refactor it and simplify. I would do it like this:Just one ctor, nothing else.
Current unit tests are absolutely wrong. They don't test the class, but instead test its interaction with encapsulated elements. It's against the idea of OOP. Let's remove current tests and create a simple integration test, which will run a server (like it's done in
FtCLITest
) and make sure the request is interrupted in a few seconds.The text was updated successfully, but these errors were encountered: