openwisp-controller icon indicating copy to clipboard operation
openwisp-controller copied to clipboard

[tests] Fix flaky tests

Open pandafy opened this issue 4 years ago • 2 comments

I have observed that CI build for Python==3.7 | django~=3.0.0 fails sometimes abruptly.

One of such occurrence is https://github.com/openwisp/openwisp-controller/pull/421/checks?check_run_id=2622952481

Let's use this issue to report such flaky tests and fix them all at once.

pandafy avatar May 20 '21 12:05 pandafy

Build fail: https://github.com/openwisp/openwisp-controller/runs/2719061481

======================================================================
FAIL: test_ca_queryset (openwisp2.sample_pki.tests.TestAdmin) [ca2]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/openwisp_users/tests/utils.py", line 99, in _test_multitenant_admin
    msg_prefix='[operator not-contains]',
  File "/opt/hostedtoolcache/Python/3.7.10/x64/lib/python3.7/site-packages/django/test/testcases.py", line 465, in assertNotContains
    self.assertEqual(real_count, 0, msg_prefix + "Response should not contain %s" % text_repr)
AssertionError: 1 != 0 : [operator not-contains]: Response should not contain 'ca2'

pandafy avatar Jun 01 '21 13:06 pandafy

This build failed randomly but doesn't look like the same issue: https://github.com/openwisp/openwisp-controller/runs/3138770831

nemesifier avatar Jul 23 '21 00:07 nemesifier