Skip to content
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

Fix test_print_to_correct_cell_from_child_thread #1312

Merged
merged 2 commits into from
Dec 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/test_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ def child_target():
sleep({interval})

def parent_target():
sleep({interval})
Thread(target=child_target).start()
sleep({interval * iterations})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it also work if in addition to this sleep you keep the sleep({interval}) above? I wonder if that was here for a reason. In other words, I think that adding the sleep at the end is fine, I am less confident about the function of the sleep that was removed (as this can change some edge case related to execution order).

Further, should we save a reference to the thread in a local variable before calling sleep()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In 41b31c5 I added back the first sleep, and replaced the other sleep with a thread.join(), since it's essentially the same.


Thread(target=parent_target).start()
"""
Expand Down
Loading