OCL API 2

Build: #1850 failed

Job: Run tests failed

Stages & jobs

  1. Build

  2. Test

  3. Deploy for testing

    Requires a user to start manually
  4. Release

    Requires a user to start manually

Job result summary

Completed
Duration
13 minutes
Agent
xindi.openmrs.org
Revision
16026d6115b8064d80d731b38525d91d6da637c4 16026d6115b8064d80d731b38525d91d6da637c4
Fixed in
#1852 (Manual run from the stage: Release by Sunny Aggarwal.)
No failed test found. A possible compilation error occurred.

Error summary

The build generated some errors. See the full build log for more details.

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/django/db/models/fields/related_descriptors.py", line 218, in __get__
    rel_obj = self.field.get_cached_value(instance)
  File "/usr/local/lib/python3.10/site-packages/django/db/models/fields/mixins.py", line 15, in get_cached_value
    return instance._state.fields_cache[cache_name]
KeyError: 'created_by'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/code/core/users/tests/tests.py", line 116, in test_user_active_inactive_should_affect_children
    user.save()
  File "/usr/local/lib/python3.10/site-packages/django/contrib/auth/base_user.py", line 76, in save
    super().save(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/django/db/models/base.py", line 814, in save
    self.save_base(
  File "/usr/local/lib/python3.10/site-packages/django/db/models/base.py", line 892, in save_base
    post_save.send(
  File "/usr/local/lib/python3.10/site-packages/django/dispatch/dispatcher.py", line 176, in send
    return [
  File "/usr/local/lib/python3.10/site-packages/django/dispatch/dispatcher.py", line 177, in <listcomp>
    (receiver, receiver(signal=self, sender=sender, **named))
  File "/code/core/common/signals.py", line 28, in propagate_owner_status
    instance.batch_index(instance.source_set, SourceDocument)
  File "/code/core/common/models.py", line 182, in batch_index
    document().update(batch, parallel=True)
  File "/usr/local/lib/python3.10/site-packages/django_elasticsearch_dsl/documents.py", line 238, in update
    return self._bulk(
  File "/usr/local/lib/python3.10/site-packages/django_elasticsearch_dsl/documents.py", line 213, in _bulk
    return self.parallel_bulk(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/django_elasticsearch_dsl/documents.py", line 180, in parallel_bulk
    deque(bulk_actions, maxlen=0)
  File "/usr/local/lib/python3.10/site-packages/elasticsearch/helpers/actions.py", line 472, in parallel_bulk
    for result in pool.imap(
  File "/usr/local/lib/python3.10/multiprocessing/pool.py", line 870, in next
    raise value
  File "/usr/local/lib/python3.10/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/usr/local/lib/python3.10/multiprocessing/pool.py", line 144, in _helper_reraises_exception
    raise ex
  File "/usr/local/lib/python3.10/multiprocessing/pool.py", line 388, in _guarded_task_generation
    for i, x in enumerate(iterable):
  File "/usr/local/lib/python3.10/site-packages/elasticsearch/helpers/actions.py", line 155, in _chunk_actions
    for action, data in actions:
  File "/usr/local/lib/python3.10/site-packages/django_elasticsearch_dsl/documents.py", line 207, in _get_actions
    yield self._prepare_action(object_instance, action)
  File "/usr/local/lib/python3.10/site-packages/django_elasticsearch_dsl/documents.py", line 200, in _prepare_action
    self.prepare(object_instance) if action != 'delete' else None
  File "/usr/local/lib/python3.10/site-packages/django_elasticsearch_dsl/documents.py", line 141, in prepare
    data = {
  File "/usr/local/lib/python3.10/site-packages/django_elasticsearch_dsl/documents.py", line 142, in <dictcomp>
    name: prep_func(instance)
  File "/code/core/sources/documents.py", line 143, in prepare_created_by
    return instance.created_by.username
  File "/usr/local/lib/python3.10/site-packages/django/db/models/fields/related_descriptors.py", line 236, in __get__
    rel_obj = self.get_object(instance)
  File "/usr/local/lib/python3.10/site-packages/django/db/models/fields/related_descriptors.py", line 199, in get_object
    return qs.get(self.field.get_reverse_related_filter(instance))
  File "/usr/local/lib/python3.10/site-packages/django/db/models/query.py", line 637, in get
    raise self.model.DoesNotExist(
core.users.models.UserProfile.DoesNotExist: UserProfile matching query does not exist.

======================================================================
FAIL: test_get_200_verbose (core.integration_tests.tests_sources.SourceSummaryViewTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/code/core/integration_tests/tests_sources.py", line 1238, in test_get_200_verbose
    self.assertEqual(
AssertionError: {'act[106 chars])], 'locale': [], 'name_type': [], 'contributors': []} != {'act[106 chars])], 'name_type': [], 'locale': [], 'contributo[18 chars] 2)]}
  {'active': 2,
   'concept_class': [('1700213508.4579756', 2)],
-  'contributors': [],
+  'contributors': [('ocladmin', 2)],
   'datatype': [('1700213508.4579756', 2)],
   'locale': [],
   'name_type': [],
   'retired': 0}

======================================================================
FAIL: test_index_children (core.sources.tests.tests.SourceTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/mock/mock.py", line 1452, in patched
    return func(*newargs, **newkeywargs)
  File "/code/core/sources/tests/tests.py", line 772, in test_index_children
    concept_document_update.assert_called_once_with(ANY, parallel=True)
  File "/usr/local/lib/python3.10/site-packages/mock/mock.py", line 992, in assert_called_once_with
    raise AssertionError(msg)
AssertionError: Expected 'update' to be called once. Called 4 times.
Calls: [call(<Concept: concept1324>, parallel=True),
call(<Concept: concept1324>, parallel=True),
call(<Concept: concept1323>, parallel=True),
call(<Concept: concept1323>, parallel=True)].

----------------------------------------------------------------------
Ran 800 tests in 736.735s

FAILED (failures=2, errors=3)
Preserving test database for alias 'default' ('test_postgres')...
1
Stopping ocl-oclapi2-rt_db_1 ...
Stopping ocl-oclapi2-rt_es_1 ...
Stopping ocl-oclapi2-rt_db_1 ... done
Stopping ocl-oclapi2-rt_es_1 ... done
Removing ocl-oclapi2-rt_db_1 ...
Removing ocl-oclapi2-rt_es_1 ...
Removing ocl-oclapi2-rt_es_1 ... done
Removing ocl-oclapi2-rt_db_1 ... done
Removing network ocl-oclapi2-rt_default
Removing volume ocl-oclapi2-rt_postgres-data
Removing volume ocl-oclapi2-rt_es-data
Removing volume ocl-oclapi2-rt_redis-data