def METHOD_NAME(self):
    r, w = os.pipe()
    self.addCleanup(os.close, r)
    self.addCleanup(os.close, w)
    rfds = []
    for i in range(10):
        fd = os.dup(r)
        self.addCleanup(os.close, fd)
        rfds.append(fd)
    pollster = select.poll()
    for fd in rfds:
        pollster.register(fd, select.POLLIN)
    t = threading.Thread(target=pollster.poll)
    t.start()
    try:
        time.sleep(0.5)
        # trigger ufds array reallocation
        for fd in rfds:
            pollster.unregister(fd)
        pollster.register(w, select.POLLOUT)
        self.assertRaises(RuntimeError, pollster.poll)
    finally:
        # and make the call to poll() from the thread return
        os.write(w, b'spam')
        t.join()