tmt icon indicating copy to clipboard operation
tmt copied to clipboard

Multihost synchronization

Open adiosnb opened this issue 3 years ago • 5 comments

The issue gathers all discussions regarding synchronization problems in multi-host tests.

adiosnb avatar Nov 24 '22 11:11 adiosnb

Adding several points and proposals from the last discussion.

All sync is an enumerator with these values:

  • start - synchronize at the beginning of the step, the first test execution
  • name - synchronize with the same test names
  • index - synchronize all tests, synchronization barrier before each test
  • none - do not synchronize

Multihost

  • L1 metadata (test metadata) key multihost: true
    • Could be used for filtering relevant multihost tests
    • Could be worked around by “filter: tag:multihost”
    • Could also be useful for syncing multihost tests only
  • Mixing singlehost & multihost tests has a real use case
    • For example single host setup tasks
    • There could be a different number of setup tasks on server/client
    • Or sandwich testing: setup / test / inter-setup / test-again
  • wow differentiates setup tasks and init tasks
    • BeakerJobWatch uses this information

Keyword correct location

Defining sync in the execution step is too late and hard to process. The current proposal is to make sync a step attribute with the values defined above.

Examples

prepare:
  - name: packages
    how: ansible
    playbook: plans/packages.yml
 - name: services
    how: shell
    script: systemctl start service
    sync: index

execute:
  how: tmt
  sync: start
discover:
  - name: setup-tasks
    how: fmf
    url: https://github.com/teemtee/tmt
    sync: none
  - name: multihost-tests
    how: fmf
    url: https://src.fedoraproject.org/rpms/tmt/
    where: client
    sync: name

adiosnb avatar Nov 24 '22 11:11 adiosnb

It would be great to gather more advanced user stories or test cases requiring complex synchronization patterns and barriers.

@sopos @kkaarreell : Would you please provide your feedback and use-cases?

adiosnb avatar Nov 24 '22 13:11 adiosnb

@adiosnb See https://github.com/teemtee/tmt/discussions/1702#discussioncomment-4226375

kkaarreell avatar Nov 24 '22 14:11 kkaarreell

Generic multi-host test discussion can be found here: https://github.com/teemtee/tmt/discussions/1702

adiosnb avatar Nov 25 '22 09:11 adiosnb

@adiosnb hi, is this issue still valid? There is a degree of synchronization implemented in tmt, as described in https://tmt.readthedocs.io/en/stable/guide.html#multihost-testing, and the test-level synchronization is not implemented on purpose, and 3rd party libraries can be used for that, as documented in https://tmt.readthedocs.io/en/stable/guide.html#synchronization-libraries.

happz avatar Apr 22 '25 08:04 happz

Basic synchronization implemented, for more advanced use cases users are adviced to check synchronization libraries.

psss avatar Oct 03 '25 10:10 psss