Uwazi: Broken Build on development branch: FAIL app/api/entities/specs/entities.spec.js (5.132s) ● entities › delete › when entity is being used as thesauri › should delete the entity id on all entities using it from select/multiselect values

Created on 11 Oct 2019  ·  7Comments  ·  Source: huridocs/uwazi

E.g. #2559 and #2573 failed the CircleCI build on https://circleci.com/gh/huridocs/uwazi/12074 and https://circleci.com/gh/huridocs/uwazi/12039 with the following test failure, even though it passed e.g. on #2575, so I suspect that this is an intermittent test that sometimes fails on CI? Just thought it would be worth having an issue for it, and record how often this happens, in case someone wants to look into this:

Summary of all failing tests
 FAIL  app/api/entities/specs/entities.spec.js (5.132s)
  ● entities › delete › when entity is being used as thesauri › should delete the entity id on all entities using it from select/multiselect values

    Failed: "Error: expect(received).toEqual(expected) // deep equality

    Expected: [\"value1\"]
    Received: undefined

      815 |         .then(() => {
      816 |           const documentsToIndex = search.bulkIndex.calls.argsFor(0)[0];
    > 817 |           expect(documentsToIndex[0].metadata.multiselect).toEqual(['value1']);
          |                                                            ^
      818 |           expect(documentsToIndex[1].metadata.multiselect2).toEqual(['value2']);
      819 |           expect(documentsToIndex[2].metadata.select).toBe('');
      820 |           expect(documentsToIndex[3].metadata.select2).toBe('');

      at toEqual (api/entities/specs/entities.spec.js:817:60)
      at process._tickCallback (../internal/process/next_tick.js:188:7)"
      at fail (api/utils/jasmineHelpers.js:4:19)


Test Suites: 1 failed, 442 passed, 443 total
Tests:       1 failed, 2626 passed, 2627 total
Snapshots:   425 passed, 425 total
Time:        241.733s
Ran all test suites in 2 projects.
Exited with code 1

Most helpful comment

I found the cause, will send pr Monday

All 7 comments

2559 failed once, but after a merge from develop it passed - coincidence, or did this just get fixed?

@vorburger maybe not related to this issue but when developing fititnt/uwazi-docker sometimes "things worked" doing again.

I'm not remember this specific issue, but that happened a few times with me. And on that case, if I recall was something related to startup of the Elastic Search or initialization of o Uwazi first time.

If you find something similar to this, maybe just document this. Or we put some extra delay at docker level before the Uwazi fail and not try restart.

Edit: if is this case, try to save on some place these random errors related to run again without full clean up, because later we could try see what is easier to bugfix. But if there is a pattern (and at least id does not broke some CI used by Huridocs) we could at least document on #2559.

This particular issue is a flakey test failure not directly related to the
Docker-ization (I think); note it also happened on a PR that has absolutely
nothing to do with Docker.

@konzz also mentioned have some issues with this at https://github.com/huridocs/uwazi/issues/2565#issuecomment-540595369. So this maybe is not very deterministic (like 100% of time works or 100% fail)

Note that the CI very likely use docker or containers, and also have to emulate Mongo, Elastic Search, etc. So this could be not related to #2559, but _still_ docker things. I mean, before debugging hard, at least consider that doing again could work. It not something that could be a release stopper, but is good at least know. One old school way to hotfixes this type of issue without changing the App source code (the JavaSript) sometimes is simply we put some sleep times after some operation (like populate a database) returns done because it could not be really done for what next operation really want.

This is one of two tests which are intermittent and for which we have not found a definitive solution.

We have looked into it, thought we had a solution, but it started failing again. We should probably invest more time into this.

I found the cause, will send pr Monday

(caused by https://github.com/huridocs/uwazi/commit/19c94ed148d33ce32a20897b18ecfef500cd93c3)

Was this page helpful?
0 / 5 - 0 ratings