tests: mark test_qunit js test and statsd test as potential failure

Note: (nspanti) hg graft -r a590ec1fd8ea.

authorLaurent Peuch <cortex@worlddomination.be>
changeset722d6ea4d885
branch3.27
phasedraft
hiddenno
parent revision#601e933448f1 [pkg] version 3.27.4
child revision#c57f8c97dd4b ci: backport gitlab-ci
files modified by this revision
cubicweb/devtools/test/unittest_qunit.py
cubicweb/test/unittest_statsd.py
# HG changeset patch
# User Laurent Peuch <cortex@worlddomination.be>
# Date 1591712209 -7200
# Tue Jun 09 16:16:49 2020 +0200
# Branch 3.27
# Node ID 722d6ea4d8857b7ec00630d12a5d73118ec18495
# Parent 601e933448f178c8072f3ae0c35e535e7de665c7
tests: mark test_qunit js test and statsd test as potential failure

Note: (nspanti) `hg graft -r a590ec1fd8ea`.

diff --git a/cubicweb/devtools/test/unittest_qunit.py b/cubicweb/devtools/test/unittest_qunit.py
@@ -1,7 +1,9 @@
1  from unittest import SkipTest
2 
3 +import pytest
4 +
5  from cubicweb.devtools import qunit
6 
7 
8  def js(name):
9      return '/static/js_examples/' + name
@@ -14,10 +16,12 @@
10          (js('test_simple_success.js'),),
11          (js('test_with_dep.js'), (js('dep_1.js'),)),
12          (js('test_with_ordered_deps.js'), (js('dep_1.js'), js('deps_2.js'),)),
13      )
14 
15 +    @pytest.mark.xfail(reason="this test randomly fail (not very often) "
16 +                       "probably due to race issues or low ressources issues")
17      def test_simple_failure(self):
18          js_tests = list(self._test_qunit(js('test_simple_failure.js')))
19          self.assertEqual(len(js_tests), 3)
20          test_1, test_2, test_3 = js_tests
21          self.assertRaises(self.failureException, test_1[1], *test_1[2:])
diff --git a/cubicweb/test/unittest_statsd.py b/cubicweb/test/unittest_statsd.py
@@ -21,10 +21,12 @@
22  import threading
23  import socket
24  import time
25  import re
26 
27 +import pytest
28 +
29  from unittest import TestCase
30  from cubicweb import statsd_logger as statsd
31 
32 
33  UDP_PORT = None
@@ -120,10 +122,12 @@
34 
35          measure_me_please()
36          self.check_received_ms('test.measure_me_please:0.0???|ms')
37          self.check_received('test.measure_me_please:1|c')
38 
39 +    @pytest.mark.xfail(reason="this test randomly fail due to race condition and we don't uses "
40 +                       "statsd anymore")
41      def test_context_manager(self):
42 
43          with statsd.statsd_timethis('cm'):
44              time.sleep(0.1)
45