Skip to content

Python tests are failing in Windows build #4040

Open
@sahas3

Description

@sahas3

There are two types of failures when running the python based tests on Windows:

  1. End-to-end execution tests are failing due to the signal.SIGALRM (used for timeout handling in the following piece of testing code) is not available for Windows

    class timeout:
    def __init__(self, seconds=1, error_message="Timeout"):
    self.seconds = seconds
    self.error_message = error_message
    def handle_timeout(self, signum, frame):
    raise TimeoutError(self.error_message)
    def __enter__(self):
    signal.signal(signal.SIGALRM, self.handle_timeout)
    signal.alarm(self.seconds)
    def __exit__(self, type, value, traceback):
    signal.alarm(0)

    One possible solution is to use the https://pypi.org/project/pytest-timeout/ plugin with pytest which offers portability across different platforms.

  2. Python API unit tests using LLVM's lit testing framework are failing due to pwd module not being available in Windows. This failure is a bit puzzling as it seems to be triggered from fx.export_and_import as seen in the logs, but running the file from CLI directly such as python test\python\fx_importer\v2.3\types_test.py doesn't produce any error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions