Skip to content

Conversation

@edwintorok
Copy link
Contributor

If you install the XAPI RPMs in your koji build environment (e.g. to build a package that depends on XAPI) then you couldn't build XAPI again anymore because its unit tests were failing. They were failing because they found some xapi hooks installed by the previous version of XAPI, whereas normally there'd be none when the unit tests are running.

Disable running XAPI hooks during unit test, even if present we are not expected to run them.

[exception] Unix.Unix_error(Unix.ENOENT, "connect", "")
            Raised at Forkhelpers.execute_command_get_output_inner.(fun) in file "ocaml/forkexecd/lib/forkhelpers.ml", line 376, characters 10-19
            Called from Xapi_stdext_pervasives__Pervasiveext.finally in file "ocaml/libs/xapi-stdext/lib/xapi-stdext-pervasives/pervasiveext.ml", line 24, characters 8-14
            Re-raised at Xapi_stdext_pervasives__Pervasiveext.finally in file "ocaml/libs/xapi-stdext/lib/xapi-stdext-pervasives/pervasiveext.ml", line 39, characters 6-15
            Called from Xapi_hooks.execute_hook.(fun) in file "ocaml/xapi/xapi_hooks.ml", line 77, characters 10-113
            Called from Stdlib__Array.iter in file "array.ml", line 95, characters 31-48
            Called from Xapi_host.destroy in file "ocaml/xapi/xapi_host.ml", line 1108, characters 2-98
            Called from Dune__exe__Test_cluster_host.test_forget in file "ocaml/tests/test_cluster_host.ml", line 192, characters 2-42
            Called from Alcotest_engine__Core.Make.protect_test.(fun) in file "src/alcotest-engine/core.ml", line 181, characters 17-23
            Called from Alcotest_engine__Monad.Identity.catch in file "src/alcotest-engine/monad.ml", line 24, characters 31-35

If you install the XAPI RPMs in your koji build environment (e.g. to build a package that depends on XAPI)
then you couldn't build XAPI again anymore because its unit tests were failing.
They were failing because they found some xapi hooks installed by the previous version of XAPI,
whereas normally there'd be none when the unit tests are running.

Disable running XAPI hooks during unit test, even if present we are not expected to run them.

```
[exception] Unix.Unix_error(Unix.ENOENT, "connect", "")
            Raised at Forkhelpers.execute_command_get_output_inner.(fun) in file "ocaml/forkexecd/lib/forkhelpers.ml", line 376, characters 10-19
            Called from Xapi_stdext_pervasives__Pervasiveext.finally in file "ocaml/libs/xapi-stdext/lib/xapi-stdext-pervasives/pervasiveext.ml", line 24, characters 8-14
            Re-raised at Xapi_stdext_pervasives__Pervasiveext.finally in file "ocaml/libs/xapi-stdext/lib/xapi-stdext-pervasives/pervasiveext.ml", line 39, characters 6-15
            Called from Xapi_hooks.execute_hook.(fun) in file "ocaml/xapi/xapi_hooks.ml", line 77, characters 10-113
            Called from Stdlib__Array.iter in file "array.ml", line 95, characters 31-48
            Called from Xapi_host.destroy in file "ocaml/xapi/xapi_host.ml", line 1108, characters 2-98
            Called from Dune__exe__Test_cluster_host.test_forget in file "ocaml/tests/test_cluster_host.ml", line 192, characters 2-42
            Called from Alcotest_engine__Core.Make.protect_test.(fun) in file "src/alcotest-engine/core.ml", line 181, characters 17-23
            Called from Alcotest_engine__Monad.Identity.catch in file "src/alcotest-engine/monad.ml", line 24, characters 31-35
```

Signed-off-by: Edwin Török <edwin.torok@cloud.com>
@edwintorok edwintorok force-pushed the private/edvint/fix-unit-test branch from 32da312 to 43d9ee9 Compare October 2, 2024 14:12
@lindig lindig marked this pull request as ready for review October 16, 2024 14:32
@lindig
Copy link
Contributor

lindig commented Oct 16, 2024

I have undrafted this. Is this ready, @edwintorok ?

@edwintorok
Copy link
Contributor Author

I think I didn't run into this problem again (I use separate kojienvs to avoid the problem), but the change itself is small and safe enough, so we could probably merge it.

@lindig lindig added this pull request to the merge queue Oct 18, 2024
Merged via the queue into xapi-project:master with commit aafb2bb Oct 18, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants