googleapis / python-aiplatform

A Python SDK for Vertex AI, a fully managed, end-to-end platform for data science and machine learning.
Apache License 2.0
589 stars 318 forks source link

tests.unit.vertexai.test_serializers.TestKerasModelSerializer: test_serialize_gcs_path_default_save_format failed #2714

Closed flaky-bot[bot] closed 9 months ago

flaky-bot[bot] commented 9 months ago

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and I will stop commenting.


commit: 8db915636bb7c7cb6a258a60c07b1b68275f3094 buildURL: Build Status, Sponge status: failed

Test output
self = 
keras_model_serializer = 
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-1/popen-gw1/test_serialize_gcs_path_defaul0')

    @pytest.mark.usefixtures("mock_storage_blob_tmp_dir")
    def test_serialize_gcs_path_default_save_format(
        self, keras_model_serializer, tmp_path
    ):
        # Arrange
        fake_gcs_uri = "gs://staging-bucket/fake_gcs_uri"

        keras_model = keras.Sequential(
            [keras.layers.Dense(8, input_shape=(2,)), keras.layers.Dense(4)]
        )

        # Act
>       keras_model_serializer.serialize(keras_model, fake_gcs_uri)

tests/unit/vertexai/test_serializers.py:470: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
vertexai/preview/_workflow/serialization_engine/serializers.py:254: in serialize
    with _get_temp_file_or_dir(
vertexai/preview/_workflow/serialization_engine/serializers.py:206: in _get_temp_file_or_dir
    tempfile.NamedTemporaryFile(suffix=file_suffix)
/usr/local/lib/python3.9/tempfile.py:547: in NamedTemporaryFile
    file = _io.open(fd, mode, buffering=buffering,
.nox/unit-3-9/lib/python3.9/site-packages/pyfakefs/fake_io.py:117: in open
    return fake_open(
.nox/unit-3-9/lib/python3.9/site-packages/pyfakefs/fake_open.py:97: in __call__
    return self.call(*args, **kwargs)
.nox/unit-3-9/lib/python3.9/site-packages/pyfakefs/fake_open.py:160: in call
    file_object, file_path, filedes, real_path = self._handle_file_arg(file_)
.nox/unit-3-9/lib/python3.9/site-packages/pyfakefs/fake_open.py:312: in _handle_file_arg
    wrapper = self.filesystem.get_open_file(filedes)
.nox/unit-3-9/lib/python3.9/site-packages/pyfakefs/fake_filesystem.py:867: in get_open_file
    self.raise_os_error(errno.EBADF, str(file_des))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 
err_no = 9, filename = '24', winerror = None

    def raise_os_error(
        self,
        err_no: int,
        filename: Optional[AnyString] = None,
        winerror: Optional[int] = None,
    ) -> NoReturn:
        """Raises OSError.
        The error message is constructed from the given error code and shall
        start with the error string issued in the real system.
        Note: this is not true under Windows if winerror is given - in this
        case a localized message specific to winerror will be shown in the
        real file system.

        Args:
            err_no: A numeric error code from the C variable errno.
            filename: The name of the affected file, if any.
            winerror: Windows only - the specific Windows error code.
        """
        message = os.strerror(err_no) + " in the fake filesystem"
        if winerror is not None and sys.platform == "win32" and self.is_windows_fs:
            raise OSError(err_no, message, filename, winerror)
>       raise OSError(err_no, message, filename)
E       OSError: [Errno 9] Bad file descriptor in the fake filesystem: '24'

.nox/unit-3-9/lib/python3.9/site-packages/pyfakefs/fake_filesystem.py:428: OSError
flaky-bot[bot] commented 9 months ago

Closing as a duplicate of #2681

flaky-bot[bot] commented 9 months ago

Closing as a duplicate of #2681

flaky-bot[bot] commented 9 months ago

Closing as a duplicate of #2681