Opensearch-build TestRunBuild failures

Version: opensearch-build

Issue: Hello, I attempted to deploy and run opensearch-build on my local machine using the steps provided in the developer guide for the Windows platform. However, I encountered an error during the “pipenv run pytest” step. It’s hard for me to determine the exact cause of the error. It would helpful if you could provide guidance or assistance in troubleshooting this problem. Thank you for your time and attention to this matter.

Relevant Logs:

PS C:\opensearch-build> pipenv run pytest
......FFF...............................................................................................................................................FF......................................... [ 28%]
................................................................................................................................................................................................... [ 56%]
..............................................................................F.................................................................................................................... [ 84%]
..........................F....................................................................................                                                                                     [100%]
================================================================================================ FAILURES ================================================================================================
_________________________________________________________________________________ TestRunBuild.test_main_platform_darwin _________________________________________________________________________________

self = <tests.test_run_build.TestRunBuild testMethod=test_main_platform_darwin>, mock_temp = <MagicMock name='TemporaryDirectory' id='2864695567624'>
mock_recorder = <MagicMock name='BuildRecorder' id='2864696870600'>, mock_builder = <MagicMock name='builder_from' id='2864696915464'>, mocks = ()

    @patch("argparse._sys.argv", ["run_build.py", OPENSEARCH_MANIFEST, "-p", "darwin"])
    @patch("run_build.Builders.builder_from", return_value=MagicMock())
    @patch("run_build.BuildRecorder", return_value=MagicMock())
    @patch("run_build.TemporaryDirectory")
    def test_main_platform_darwin(self, mock_temp: Mock, mock_recorder: Mock, mock_builder: Mock, *mocks: Any) -> None:
        mock_temp.return_value.__enter__.return_value.name = tempfile.gettempdir()
>       main()

tests\test_run_build.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  
src\run_build.py:55: in main
    architecture=args.architecture or manifest.build.architecture,
src\build_workflow\build_target.py:45: in __init__
    self.architecture = architecture or current_architecture()
src\system\os.py:13: in current_architecture
    architecture = subprocess.check_output(["uname", "-m"]).decode().strip()
C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py:411: in check_output
    **kwargs).stdout
C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py:488: in run
    with Popen(*popenargs, **kwargs) as process:
C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py:800: in __init__
    restore_signals, start_new_session)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  

self = <subprocess.Popen object at 0x0000029AFD406A08>, args = 'uname -m', executable = None, preexec_fn = None, close_fds = False, pass_fds = (), cwd = None, env = None
startupinfo = <subprocess.STARTUPINFO object at 0x0000029AFD406C48>, creationflags = 0, shell = False, p2cread = Handle(668), p2cwrite = -1, c2pread = 20, c2pwrite = Handle(828), errread = -1
errwrite = Handle(872), unused_restore_signals = True, unused_start_new_session = False

    def _execute_child(self, args, executable, preexec_fn, close_fds,
                       pass_fds, cwd, env,
                       startupinfo, creationflags, shell,
                       p2cread, p2cwrite,
                       c2pread, c2pwrite,
                       errread, errwrite,
                       unused_restore_signals, unused_start_new_session):
        """Execute program (MS Windows version)"""

        assert not pass_fds, "pass_fds not supported on Windows."

        if not isinstance(args, str):
            args = list2cmdline(args)

        # Process startup details
        if startupinfo is None:
            startupinfo = STARTUPINFO()
        else:
            # bpo-34044: Copy STARTUPINFO since it is modified above,
            # so the caller can reuse it multiple times.
            startupinfo = startupinfo._copy()

        use_std_handles = -1 not in (p2cread, c2pwrite, errwrite)
        if use_std_handles:
            startupinfo.dwFlags |= _winapi.STARTF_USESTDHANDLES
            startupinfo.hStdInput = p2cread
            startupinfo.hStdOutput = c2pwrite
            startupinfo.hStdError = errwrite

        attribute_list = startupinfo.lpAttributeList
        have_handle_list = bool(attribute_list and
                                "handle_list" in attribute_list and
                                attribute_list["handle_list"])

        # If we were given an handle_list or need to create one
        if have_handle_list or (use_std_handles and close_fds):
            if attribute_list is None:
                attribute_list = startupinfo.lpAttributeList = {}
            handle_list = attribute_list["handle_list"] = \
                list(attribute_list.get("handle_list", []))

            if use_std_handles:
                handle_list += [int(p2cread), int(c2pwrite), int(errwrite)]

            handle_list[:] = self._filter_handle_list(handle_list)

            if handle_list:
                if not close_fds:
                    warnings.warn("startupinfo.lpAttributeList['handle_list'] "
                                  "overriding close_fds", RuntimeWarning)

                # When using the handle_list we always request to inherit
                # handles but the only handles that will be inherited are
                # the ones in the handle_list
                close_fds = False

        if shell:
            startupinfo.dwFlags |= _winapi.STARTF_USESHOWWINDOW
            startupinfo.wShowWindow = _winapi.SW_HIDE
            comspec = os.environ.get("COMSPEC", "cmd.exe")
            args = '{} /c "{}"'.format (comspec, args)

        # Start the process
        try:
            hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                                     # no special security
                                     None, None,
                                     int(not close_fds),
                                     creationflags,
                                     env,
                                     os.fspath(cwd) if cwd is not None else None,
>                                    startupinfo)
E                                    FileNotFoundError: [WinError 2] Не удается найти указанный файл

C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py:1207: FileNotFoundError
_________________________________________________________________________________ TestRunBuild.test_main_platform_linux __________________________________________________________________________________ 

self = <tests.test_run_build.TestRunBuild testMethod=test_main_platform_linux>, mock_temp = <MagicMock name='TemporaryDirectory' id='2864696861000'>
mock_recorder = <MagicMock name='BuildRecorder' id='2864697431944'>, mock_builder = <MagicMock name='builder_from' id='2864697411784'>, mocks = ()

    @patch("argparse._sys.argv", ["run_build.py", OPENSEARCH_MANIFEST, "-p", "linux"])
    @patch("run_build.Builders.builder_from", return_value=MagicMock())
    @patch("run_build.BuildRecorder", return_value=MagicMock())
    @patch("run_build.TemporaryDirectory")
    def test_main_platform_linux(self, mock_temp: Mock, mock_recorder: Mock, mock_builder: Mock, *mocks: Any) -> None:
        mock_temp.return_value.__enter__.return_value.name = tempfile.gettempdir()
>       main()

tests\test_run_build.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  
src\run_build.py:55: in main
    architecture=args.architecture or manifest.build.architecture,
src\build_workflow\build_target.py:45: in __init__
    self.architecture = architecture or current_architecture()
src\system\os.py:13: in current_architecture
    architecture = subprocess.check_output(["uname", "-m"]).decode().strip()
C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py:411: in check_output
    **kwargs).stdout
C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py:488: in run
    with Popen(*popenargs, **kwargs) as process:
C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py:800: in __init__
    restore_signals, start_new_session)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  

self = <subprocess.Popen object at 0x0000029AFD51C748>, args = 'uname -m', executable = None, preexec_fn = None, close_fds = False, pass_fds = (), cwd = None, env = None
startupinfo = <subprocess.STARTUPINFO object at 0x0000029AFD51C948>, creationflags = 0, shell = False, p2cread = Handle(888), p2cwrite = -1, c2pread = 21, c2pwrite = Handle(424), errread = -1
errwrite = Handle(732), unused_restore_signals = True, unused_start_new_session = False

    def _execute_child(self, args, executable, preexec_fn, close_fds,
                       pass_fds, cwd, env,
                       startupinfo, creationflags, shell,
                       p2cread, p2cwrite,
                       c2pread, c2pwrite,
                       errread, errwrite,
                       unused_restore_signals, unused_start_new_session):
        """Execute program (MS Windows version)"""

        assert not pass_fds, "pass_fds not supported on Windows."

        if not isinstance(args, str):
            args = list2cmdline(args)

        # Process startup details
        if startupinfo is None:
            startupinfo = STARTUPINFO()
        else:
            # bpo-34044: Copy STARTUPINFO since it is modified above,
            # so the caller can reuse it multiple times.
            startupinfo = startupinfo._copy()

        use_std_handles = -1 not in (p2cread, c2pwrite, errwrite)
        if use_std_handles:
            startupinfo.dwFlags |= _winapi.STARTF_USESTDHANDLES
            startupinfo.hStdInput = p2cread
            startupinfo.hStdOutput = c2pwrite
            startupinfo.hStdError = errwrite

        attribute_list = startupinfo.lpAttributeList
        have_handle_list = bool(attribute_list and
                                "handle_list" in attribute_list and
                                attribute_list["handle_list"])

        # If we were given an handle_list or need to create one
        if have_handle_list or (use_std_handles and close_fds):
            if attribute_list is None:
                attribute_list = startupinfo.lpAttributeList = {}
            handle_list = attribute_list["handle_list"] = \
                list(attribute_list.get("handle_list", []))

            if use_std_handles:
                handle_list += [int(p2cread), int(c2pwrite), int(errwrite)]

            handle_list[:] = self._filter_handle_list(handle_list)

            if handle_list:
                if not close_fds:
                    warnings.warn("startupinfo.lpAttributeList['handle_list'] "
                                  "overriding close_fds", RuntimeWarning)

                # When using the handle_list we always request to inherit
                # handles but the only handles that will be inherited are
                # the ones in the handle_list
                close_fds = False

        if shell:
            startupinfo.dwFlags |= _winapi.STARTF_USESHOWWINDOW
            startupinfo.wShowWindow = _winapi.SW_HIDE
            comspec = os.environ.get("COMSPEC", "cmd.exe")
            args = '{} /c "{}"'.format (comspec, args)

        # Start the process
        try:
            hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                                     # no special security
                                     None, None,
                                     int(not close_fds),
                                     creationflags,
                                     env,
                                     os.fspath(cwd) if cwd is not None else None,
>                                    startupinfo)
E                                    FileNotFoundError: [WinError 2] Не удается найти указанный файл

C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py:1207: FileNotFoundError
________________________________________________________________________________ TestRunBuild.test_main_platform_windows _________________________________________________________________________________ 

self = <tests.test_run_build.TestRunBuild testMethod=test_main_platform_windows>, mock_temp = <MagicMock name='TemporaryDirectory' id='2864695562824'>
mock_recorder = <MagicMock name='BuildRecorder' id='2864695610312'>, mock_builder = <MagicMock name='builder_from' id='2864697412936'>, mocks = ()

    @patch("argparse._sys.argv", ["run_build.py", OPENSEARCH_MANIFEST, "-p", "windows"])
    @patch("run_build.Builders.builder_from", return_value=MagicMock())
    @patch("run_build.BuildRecorder", return_value=MagicMock())
    @patch("run_build.TemporaryDirectory")
    def test_main_platform_windows(self, mock_temp: Mock, mock_recorder: Mock, mock_builder: Mock, *mocks: Any) -> None:
        mock_temp.return_value.__enter__.return_value.name = tempfile.gettempdir()
>       main()

tests\test_run_build.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  
src\run_build.py:55: in main
    architecture=args.architecture or manifest.build.architecture,
src\build_workflow\build_target.py:45: in __init__
    self.architecture = architecture or current_architecture()
src\system\os.py:13: in current_architecture
    architecture = subprocess.check_output(["uname", "-m"]).decode().strip()
C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py:411: in check_output
    **kwargs).stdout
C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py:488: in run
    with Popen(*popenargs, **kwargs) as process:
C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py:800: in __init__
    restore_signals, start_new_session)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  

self = <subprocess.Popen object at 0x0000029AFD412988>, args = 'uname -m', executable = None, preexec_fn = None, close_fds = False, pass_fds = (), cwd = None, env = None
startupinfo = <subprocess.STARTUPINFO object at 0x0000029AFD412888>, creationflags = 0, shell = False, p2cread = Handle(892), p2cwrite = -1, c2pread = 22, c2pwrite = Handle(876), errread = -1
errwrite = Handle(672), unused_restore_signals = True, unused_start_new_session = False

    def _execute_child(self, args, executable, preexec_fn, close_fds,
                       pass_fds, cwd, env,
                       startupinfo, creationflags, shell,
                       p2cread, p2cwrite,
                       c2pread, c2pwrite,
                       errread, errwrite,
                       unused_restore_signals, unused_start_new_session):
        """Execute program (MS Windows version)"""

        assert not pass_fds, "pass_fds not supported on Windows."

        if not isinstance(args, str):
            args = list2cmdline(args)

        # Process startup details
        if startupinfo is None:
            startupinfo = STARTUPINFO()
        else:
            # bpo-34044: Copy STARTUPINFO since it is modified above,
            # so the caller can reuse it multiple times.
            startupinfo = startupinfo._copy()

        use_std_handles = -1 not in (p2cread, c2pwrite, errwrite)
        if use_std_handles:
            startupinfo.dwFlags |= _winapi.STARTF_USESTDHANDLES
            startupinfo.hStdInput = p2cread
            startupinfo.hStdOutput = c2pwrite
            startupinfo.hStdError = errwrite

        attribute_list = startupinfo.lpAttributeList
        have_handle_list = bool(attribute_list and
                                "handle_list" in attribute_list and
                                attribute_list["handle_list"])

        # If we were given an handle_list or need to create one
        if have_handle_list or (use_std_handles and close_fds):
            if attribute_list is None:
                attribute_list = startupinfo.lpAttributeList = {}
            handle_list = attribute_list["handle_list"] = \
                list(attribute_list.get("handle_list", []))

            if use_std_handles:
                handle_list += [int(p2cread), int(c2pwrite), int(errwrite)]

            handle_list[:] = self._filter_handle_list(handle_list)

            if handle_list:
                if not close_fds:
                    warnings.warn("startupinfo.lpAttributeList['handle_list'] "
                                  "overriding close_fds", RuntimeWarning)

                # When using the handle_list we always request to inherit
                # handles but the only handles that will be inherited are
                # the ones in the handle_list
                close_fds = False

        if shell:
            startupinfo.dwFlags |= _winapi.STARTF_USESHOWWINDOW
            startupinfo.wShowWindow = _winapi.SW_HIDE
            comspec = os.environ.get("COMSPEC", "cmd.exe")
            args = '{} /c "{}"'.format (comspec, args)

        # Start the process
        try:
            hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                                     # no special security
                                     None, None,
                                     int(not close_fds),
                                     creationflags,
                                     env,
                                     os.fspath(cwd) if cwd is not None else None,
>                                    startupinfo)
E                                    FileNotFoundError: [WinError 2] Не удается найти указанный файл

C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py:1207: FileNotFoundError
_____________________________________________________________________________________ TestBuildTarget.test_platform ______________________________________________________________________________________ 

self = <tests.tests_build_workflow.test_build_target.TestBuildTarget testMethod=test_platform>, value_platform = <MagicMock name='current_platform' id='2864690507976'>

    @patch("build_workflow.build_target.current_platform", return_value="value")
    def test_platform(self, value_platform: Mock) -> None:
>       self.assertEqual(BuildTarget(version="1.1.0", snapshot=False).platform, "value")

tests\tests_build_workflow\test_build_target.py:124:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  
src\build_workflow\build_target.py:45: in __init__
    self.architecture = architecture or current_architecture()
src\system\os.py:13: in current_architecture
    architecture = subprocess.check_output(["uname", "-m"]).decode().strip()
C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py:411: in check_output
    **kwargs).stdout
C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py:488: in run
    with Popen(*popenargs, **kwargs) as process:
C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py:800: in __init__
    restore_signals, start_new_session)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  

self = <subprocess.Popen object at 0x0000029AFD387788>, args = 'uname -m', executable = None, preexec_fn = None, close_fds = False, pass_fds = (), cwd = None, env = None
startupinfo = <subprocess.STARTUPINFO object at 0x0000029AFD3B9B48>, creationflags = 0, shell = False, p2cread = Handle(820), p2cwrite = -1, c2pread = 15, c2pwrite = Handle(952), errread = -1
errwrite = Handle(516), unused_restore_signals = True, unused_start_new_session = False

    def _execute_child(self, args, executable, preexec_fn, close_fds,
                       pass_fds, cwd, env,
                       startupinfo, creationflags, shell,
                       p2cread, p2cwrite,
                       c2pread, c2pwrite,
                       errread, errwrite,
                       unused_restore_signals, unused_start_new_session):
        """Execute program (MS Windows version)"""

        assert not pass_fds, "pass_fds not supported on Windows."

        if not isinstance(args, str):
            args = list2cmdline(args)

        # Process startup details
        if startupinfo is None:
            startupinfo = STARTUPINFO()
        else:
            # bpo-34044: Copy STARTUPINFO since it is modified above,
            # so the caller can reuse it multiple times.
            startupinfo = startupinfo._copy()

        use_std_handles = -1 not in (p2cread, c2pwrite, errwrite)
        if use_std_handles:
            startupinfo.dwFlags |= _winapi.STARTF_USESTDHANDLES
            startupinfo.hStdInput = p2cread
            startupinfo.hStdOutput = c2pwrite
            startupinfo.hStdError = errwrite

        attribute_list = startupinfo.lpAttributeList
        have_handle_list = bool(attribute_list and
                                "handle_list" in attribute_list and
                                attribute_list["handle_list"])

        # If we were given an handle_list or need to create one
        if have_handle_list or (use_std_handles and close_fds):
            if attribute_list is None:
                attribute_list = startupinfo.lpAttributeList = {}
            handle_list = attribute_list["handle_list"] = \
                list(attribute_list.get("handle_list", []))

            if use_std_handles:
                handle_list += [int(p2cread), int(c2pwrite), int(errwrite)]

            handle_list[:] = self._filter_handle_list(handle_list)

            if handle_list:
                if not close_fds:
                    warnings.warn("startupinfo.lpAttributeList['handle_list'] "
                                  "overriding close_fds", RuntimeWarning)

                # When using the handle_list we always request to inherit
                # handles but the only handles that will be inherited are
                # the ones in the handle_list
                close_fds = False

        if shell:
            startupinfo.dwFlags |= _winapi.STARTF_USESHOWWINDOW
            startupinfo.wShowWindow = _winapi.SW_HIDE
            comspec = os.environ.get("COMSPEC", "cmd.exe")
            args = '{} /c "{}"'.format (comspec, args)

        # Start the process
        try:
            hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                                     # no special security
                                     None, None,
                                     int(not close_fds),
                                     creationflags,
                                     env,
                                     os.fspath(cwd) if cwd is not None else None,
>                                    startupinfo)
E                                    FileNotFoundError: [WinError 2] Не удается найти указанный файл

C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py:1207: FileNotFoundError
__________________________________________________________________________________ TestBuildTarget.test_platform_value ___________________________________________________________________________________ 

self = <tests.tests_build_workflow.test_build_target.TestBuildTarget testMethod=test_platform_value>

    def test_platform_value(self) -> None:
>       self.assertEqual(BuildTarget(version="1.1.0", platform="value", snapshot=False).platform, "value")

tests\tests_build_workflow\test_build_target.py:128:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  
src\build_workflow\build_target.py:45: in __init__
    self.architecture = architecture or current_architecture()
src\system\os.py:13: in current_architecture
    architecture = subprocess.check_output(["uname", "-m"]).decode().strip()
C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py:411: in check_output
    **kwargs).stdout
C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py:488: in run
    with Popen(*popenargs, **kwargs) as process:
C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py:800: in __init__
    restore_signals, start_new_session)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  

self = <subprocess.Popen object at 0x0000029AFD280EC8>, args = 'uname -m', executable = None, preexec_fn = None, close_fds = False, pass_fds = (), cwd = None, env = None
startupinfo = <subprocess.STARTUPINFO object at 0x0000029AFD280588>, creationflags = 0, shell = False, p2cread = Handle(464), p2cwrite = -1, c2pread = 15, c2pwrite = Handle(1016), errread = -1
errwrite = Handle(900), unused_restore_signals = True, unused_start_new_session = False

    def _execute_child(self, args, executable, preexec_fn, close_fds,
                       pass_fds, cwd, env,
                       startupinfo, creationflags, shell,
                       p2cread, p2cwrite,
                       c2pread, c2pwrite,
                       errread, errwrite,
                       unused_restore_signals, unused_start_new_session):
        """Execute program (MS Windows version)"""

        assert not pass_fds, "pass_fds not supported on Windows."

        if not isinstance(args, str):
            args = list2cmdline(args)

        # Process startup details
        if startupinfo is None:
            startupinfo = STARTUPINFO()
        else:
            # bpo-34044: Copy STARTUPINFO since it is modified above,
            # so the caller can reuse it multiple times.
            startupinfo = startupinfo._copy()

        use_std_handles = -1 not in (p2cread, c2pwrite, errwrite)
        if use_std_handles:
            startupinfo.dwFlags |= _winapi.STARTF_USESTDHANDLES
            startupinfo.hStdInput = p2cread
            startupinfo.hStdOutput = c2pwrite
            startupinfo.hStdError = errwrite

        attribute_list = startupinfo.lpAttributeList
        have_handle_list = bool(attribute_list and
                                "handle_list" in attribute_list and
                                attribute_list["handle_list"])

        # If we were given an handle_list or need to create one
        if have_handle_list or (use_std_handles and close_fds):
            if attribute_list is None:
                attribute_list = startupinfo.lpAttributeList = {}
            handle_list = attribute_list["handle_list"] = \
                list(attribute_list.get("handle_list", []))

            if use_std_handles:
                handle_list += [int(p2cread), int(c2pwrite), int(errwrite)]

            handle_list[:] = self._filter_handle_list(handle_list)

            if handle_list:
                if not close_fds:
                    warnings.warn("startupinfo.lpAttributeList['handle_list'] "
                                  "overriding close_fds", RuntimeWarning)

                # When using the handle_list we always request to inherit
                # handles but the only handles that will be inherited are
                # the ones in the handle_list
                close_fds = False

        if shell:
            startupinfo.dwFlags |= _winapi.STARTF_USESHOWWINDOW
            startupinfo.wShowWindow = _winapi.SW_HIDE
            comspec = os.environ.get("COMSPEC", "cmd.exe")
            args = '{} /c "{}"'.format (comspec, args)

        # Start the process
        try:
            hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                                     # no special security
                                     None, None,
                                     int(not close_fds),
                                     creationflags,
                                     env,
                                     os.fspath(cwd) if cwd is not None else None,
>                                    startupinfo)
E                                    FileNotFoundError: [WinError 2] Не удается найти указанный файл

C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py:1207: FileNotFoundError
____________________________________________________________________________________ TestOs.test_current_architecture ____________________________________________________________________________________ 

self = <tests.tests_system.test_os.TestOs testMethod=test_current_architecture>

    def test_current_architecture(self) -> None:
>       self.assertTrue(current_architecture() in ["x64", "arm64"])

tests\tests_system\test_os.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  
src\system\os.py:13: in current_architecture
    architecture = subprocess.check_output(["uname", "-m"]).decode().strip()
C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py:411: in check_output
    **kwargs).stdout
C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py:488: in run
    with Popen(*popenargs, **kwargs) as process:
C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py:800: in __init__
    restore_signals, start_new_session)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  

self = <subprocess.Popen object at 0x0000029AFD31A408>, args = 'uname -m', executable = None, preexec_fn = None, close_fds = False, pass_fds = (), cwd = None, env = None
startupinfo = <subprocess.STARTUPINFO object at 0x0000029AFD31A488>, creationflags = 0, shell = False, p2cread = Handle(1020), p2cwrite = -1, c2pread = 16, c2pwrite = Handle(876), errread = -1
errwrite = Handle(444), unused_restore_signals = True, unused_start_new_session = False

    def _execute_child(self, args, executable, preexec_fn, close_fds,
                       pass_fds, cwd, env,
                       startupinfo, creationflags, shell,
                       p2cread, p2cwrite,
                       c2pread, c2pwrite,
                       errread, errwrite,
                       unused_restore_signals, unused_start_new_session):
        """Execute program (MS Windows version)"""

        assert not pass_fds, "pass_fds not supported on Windows."

        if not isinstance(args, str):
            args = list2cmdline(args)

        # Process startup details
        if startupinfo is None:
            startupinfo = STARTUPINFO()
        else:
            # bpo-34044: Copy STARTUPINFO since it is modified above,
            # so the caller can reuse it multiple times.
            startupinfo = startupinfo._copy()

        use_std_handles = -1 not in (p2cread, c2pwrite, errwrite)
        if use_std_handles:
            startupinfo.dwFlags |= _winapi.STARTF_USESTDHANDLES
            startupinfo.hStdInput = p2cread
            startupinfo.hStdOutput = c2pwrite
            startupinfo.hStdError = errwrite

        attribute_list = startupinfo.lpAttributeList
        have_handle_list = bool(attribute_list and
                                "handle_list" in attribute_list and
                                attribute_list["handle_list"])

        # If we were given an handle_list or need to create one
        if have_handle_list or (use_std_handles and close_fds):
            if attribute_list is None:
                attribute_list = startupinfo.lpAttributeList = {}
            handle_list = attribute_list["handle_list"] = \
                list(attribute_list.get("handle_list", []))

            if use_std_handles:
                handle_list += [int(p2cread), int(c2pwrite), int(errwrite)]

            handle_list[:] = self._filter_handle_list(handle_list)

            if handle_list:
                if not close_fds:
                    warnings.warn("startupinfo.lpAttributeList['handle_list'] "
                                  "overriding close_fds", RuntimeWarning)

                # When using the handle_list we always request to inherit
                # handles but the only handles that will be inherited are
                # the ones in the handle_list
                close_fds = False

        if shell:
            startupinfo.dwFlags |= _winapi.STARTF_USESHOWWINDOW
            startupinfo.wShowWindow = _winapi.SW_HIDE
            comspec = os.environ.get("COMSPEC", "cmd.exe")
            args = '{} /c "{}"'.format (comspec, args)

        # Start the process
        try:
            hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                                     # no special security
                                     None, None,
                                     int(not close_fds),
                                     creationflags,
                                     env,
                                     os.fspath(cwd) if cwd is not None else None,
>                                    startupinfo)
E                                    FileNotFoundError: [WinError 2] Не удается найти указанный файл

C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py:1207: FileNotFoundError
_________________________________________________________________________________ ServiceOpenSearchTests.test_terminate __________________________________________________________________________________ 

self = <integ_test.test_service_opensearch.ServiceOpenSearchTests testMethod=test_terminate>, mock_process_stderr_data = <PropertyMock name='stderr_data' id='2864721249992'>
mock_process_stdout_data = <PropertyMock name='stdout_data' id='2864721251784'>, mock_process_started = <PropertyMock name='started' id='2864730956168'>
mock_process_terminate = <MagicMock name='terminate' id='2864721248456'>

    @patch("test_workflow.integ_test.service.Process.terminate", return_value=123)
    @patch('test_workflow.integ_test.service.Process.started', new_callable=PropertyMock, return_value=True)
    @patch('test_workflow.integ_test.service.Process.stdout_data', new_callable=PropertyMock, return_value="test stdout_data")
    @patch('test_workflow.integ_test.service.Process.stderr_data', new_callable=PropertyMock, return_value="test stderr_data")
    def test_terminate(
        self,
        mock_process_stderr_data: Mock,
        mock_process_stdout_data: Mock,
        mock_process_started: Mock,
        mock_process_terminate: Mock
    ) -> None:
        service = ServiceOpenSearch(
            self.version,
            self.distribution,
            self.additional_config,
            True,
            self.dependency_installer,
            self.work_dir
        )

>       termination_result = service.terminate()

C:\opensearch-build\tests\tests_test_workflow\test_integ_workflow\integ_test\test_service_opensearch.py:198:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  
C:\opensearch-build\src\test_workflow\integ_test\service.py:67: in terminate
    self.uninstall()
C:\opensearch-build\src\test_workflow\integ_test\service_opensearch.py:60: in uninstall
    self.dist.uninstall()
C:\opensearch-build\src\test_workflow\integ_test\distribution_tar.py:43: in uninstall
    subprocess.check_call(f"rm -rf {self.work_dir}/*", shell=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  

popenargs = ('rm -rf test_work_dir/*',), kwargs = {'shell': True}, retcode = 1, cmd = 'rm -rf test_work_dir/*'

    def check_call(*popenargs, **kwargs):
        """Run command with arguments.  Wait for command to complete.  If
        the exit code was zero then return, otherwise raise
        CalledProcessError.  The CalledProcessError object will have the
        return code in the returncode attribute.

        The arguments are the same as for the call function.  Example:

        check_call(["ls", "-l"])
        """
        retcode = call(*popenargs, **kwargs)
        if retcode:
            cmd = kwargs.get("args")
            if cmd is None:
                cmd = popenargs[0]
>           raise CalledProcessError(retcode, cmd)
E           subprocess.CalledProcessError: Command 'rm -rf test_work_dir/*' returned non-zero exit status 1.

C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py:363: CalledProcessError
------------------------------------------------------------------------------------------ Captured stderr call ------------------------------------------------------------------------------------------ 
'rm' is not recognized as an internal or external command,
operable program or batch file.
============================================================================================ warnings summary ============================================================================================ 
tests/tests_system/test_temporary_directory.py::TestTemporaryDirectory::test_remove_readonly
  C:\opensearch-build\tests\../src\system\temporary_directory.py:27: DeprecationWarning: The 'warn' function is deprecated, use 'warning' instead
    logging.warn(f'Removing try count: {retry_count + 1}/{retry_total} for {path}')
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================================================================================== short test summary info =========================================================================================
FAILED tests/test_run_build.py::TestRunBuild::test_main_platform_darwin - FileNotFoundError: [WinError 2] Не удается найти указанный файл(Cannot find the specified file)
FAILED tests/test_run_build.py::TestRunBuild::test_main_platform_linux - FileNotFoundError: [WinError 2] Не удается найти указанный файл(Cannot find the specified file)
FAILED tests/test_run_build.py::TestRunBuild::test_main_platform_windows - FileNotFoundError: [WinError 2] Не удается найти указанный файл(Cannot find the specified file)
FAILED tests/tests_build_workflow/test_build_target.py::TestBuildTarget::test_platform - FileNotFoundError: [WinError 2] Не удается найти указанный файл(Cannot find the specified file)
FAILED tests/tests_build_workflow/test_build_target.py::TestBuildTarget::test_platform_value - FileNotFoundError: [WinError 2] Не удается найти указанный файл(Cannot find the specified file)
FAILED tests/tests_system/test_os.py::TestOs::test_current_architecture - FileNotFoundError: [WinError 2] Не удается найти указанный файл(Cannot find the specified file)
FAILED tests/tests_test_workflow/test_integ_workflow/integ_test/test_service_opensearch.py::ServiceOpenSearchTests::test_terminate - subprocess.CalledProcessError: Command 'rm -rf test_work_dir/*' ret...7 failed, 689 passed, 1 warning in 68.02s (0:01:08)