Skip to content

[BUG] test isolation in XQSuite #6065

@line-o

Description

@line-o

Describe the bug

While working on #6060 I noticed that tests, specifically the tests calling fn:transform are inadequately isolated against each other.
I want to stress that this is either an issue within fn:transform or the xqsuite test runner or both. See also this issue with main modules that evaluate to a deferred function call which leads to undeterministic test case failures.

I created a gist with the necessary information in order to keep this issue description brief.

The gist (of the gist)

declare %test:assertEquals("<a />") function xqsuite-test-isolation:test-1() {
    transform($options)?output
};

declare %test:assertEquals("<a />") function xqsuite-test-isolation:test-2() {
    transform($options)?output
};

test-2 will fail because it receives 2 nodes as a result instead of just one. The first node being the result of test-1

Expected behavior

The tests to be isolated enough so that results from a previous test can never influence a later test case.

To Reproduce

Store https://gist.github.com/line-o/4731ed367f437be9cd036b152a18d340#file-xqsuite-test-isolation-xqm in an instance of exist 7.0.0-SNAPSHOT or 6.4.1-SNAPSHOT and run them.

While the first test that is executed will pass all following ones do not. They all fail with a cardinality error.

Add the delivery-format option or the additional empty-sequence to see that this mitigates the issue entirely.

Context (please always complete the following information)

  • Build: eXist-7.0.0-SNAPSHOT (1d5848b)
  • Java: 21.0.8 (Eclipse Adoptium)
  • OS: Linux 6.12.54-linuxkit (aarch64)

Additional context

  • How is eXist-db installed? docker
  • Any custom changes in e.g. conf.xml? none

Metadata

Metadata

Assignees

No one assigned

    Labels

    investigateissues being looked at

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions