Skip to content

Commit

Permalink
Mark flaky tests (#25463)
Browse files Browse the repository at this point in the history
Make CI less brittle
  • Loading branch information
amyeroberts authored Aug 11, 2023
1 parent 11757e2 commit 5e5fa0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/models/wav2vec2/test_modeling_tf_wav2vec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def check_labels_out_of_vocab(self, config, input_values, *args):
model = TFWav2Vec2ForCTC(config)
input_lengths = tf.constant([input_values.shape[-1] // i for i in [4, 2, 1]])
max_length_labels = model.wav2vec2._get_feat_extract_output_lengths(input_lengths)
labels = ids_tensor((input_values.shape[0], min(max_length_labels) - 1), model.config.vocab_size + 100)
labels = ids_tensor((input_values.shape[0], min(max_length_labels) - 1), model.config.vocab_size + 500)
with pytest.raises(ValueError):
model(input_values, labels=labels)

Expand Down
3 changes: 2 additions & 1 deletion tests/utils/test_image_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from tests.pipelines.test_pipelines_document_question_answering import INVOICE_URL
from transformers import is_torch_available, is_vision_available
from transformers.image_utils import ChannelDimension, get_channel_dimension_axis, make_list_of_images
from transformers.testing_utils import require_torch, require_vision
from transformers.testing_utils import is_flaky, require_torch, require_vision


if is_torch_available():
Expand Down Expand Up @@ -486,6 +486,7 @@ def test_load_img_url(self):

self.assertEqual(img_arr.shape, (1061, 750, 3))

@is_flaky()
def test_load_img_url_timeout(self):
with self.assertRaises(ReadTimeout):
load_image(INVOICE_URL, timeout=0.001)
Expand Down

0 comments on commit 5e5fa0d

Please sign in to comment.