[3.6] bpo-31150: Wait for child process in test_forkinthread to avoid… · python/cpython@4388b42 (original) (raw)
Navigation Menu
- GitHub Copilot Write better code with AI
- GitHub Models New Manage and compare prompts
- GitHub Advanced Security Find and fix vulnerabilities
- Actions Automate any workflow
- Codespaces Instant dev environments
- Issues Plan and track work
- Code Review Manage code changes
- Discussions Collaborate outside of code
- Code Search Find more, search less
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Commit 4388b42
authored and
committed
[3.6] bpo-31150: Wait for child process in test_forkinthread to avoid thread reaped warnings (#3041)
File tree
1 file changed
lines changed
1 file changed
lines changed
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -239,6 +239,8 @@ def thread1(): | ||
239 | 239 | os._exit(0) |
240 | 240 | else: # parent |
241 | 241 | os.close(self.write_fd) |
242 | +pid, status = os.waitpid(pid, 0) | |
243 | +self.assertEqual(status, 0) | |
242 | 244 | |
243 | 245 | thread.start_new_thread(thread1, ()) |
244 | 246 | self.assertEqual(os.read(self.read_fd, 2), b"OK", |