Giter VIP home page Giter VIP logo

Comments (3)

grondo avatar grondo commented on June 16, 2024

The key is to execute your tests as the argument to flux start. Without any arguments flux start launches an interactive shell -- I'm not sure what would happen in a non-interactive environment like Github CI, possibly a hang or an error like you are seeing.

In your example repo above, you run flux start, then flux submit in a separate shell. This won't work because only the shell or program started by flux start has access to the test instance that has been created.

The rmsi_init error is from hwloc, I'm not sure why you see Exception caught with it, when I've seen it, it is a harmless error message.

For more background, flux start starts a flux instance (mostly for testing) with one or more brokers (e.g. you can start a test instance with 4 brokers with flux start --test-size=4) and launches an interactive shell with access to that instance (by setting FLUX_URI to the URI of the rank 0 broker for the newly created instance). This allows multiple instances to be started on a single system in parallel without interfering with each other. If flux start is given an argument then this script is run instead of an interactive shell, and the instance terminates automatically when the script is complete (we call this an "initial program" and it works very much like a batch script).

The flux-core testsuite and the tests of many of its subprojects use flux start to run automated tests in CI. Our testsuite is based on sharness, I'd be happy to go into more detail how it works if you'd like. You could then decide if borrowing the framework would work for your testing purposes.

from flux-core.

jan-janssen avatar jan-janssen commented on June 16, 2024

Oh great, I thought the error message meant that flux was not able to start the broker. All I had to do was change the run: | line to run: >. Just in case somebody else wants to reproduce the environment:

name: Flux

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]


jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: conda-incubator/[email protected]
      with:
        python-version: "3.11"
        mamba-version: "*"
        channels: conda-forge
        miniforge-variant: Mambaforge
        channel-priority: strict
        auto-update-conda: true
        environment-file: "environment.yml"
    - name: Install flux
      shell: bash -l {0}
      run: mamba install -y flux-core
    - name: Test
      shell: 'script -q -e -c "bash -l {0}"'
      timeout-minutes: 5
      run: >
        flux start
        flux submit sleep 1
        sleep 2
        flux jobs -a
        flux resource list

from flux-core.

grondo avatar grondo commented on June 16, 2024

Great!

I'm still not sure that's going to do exactly what you want since won't it run basically

flux start flux submit sleep 1 sleep 2 flux jobs -a flux resource list

If so, the flux start will start exiting immediately after flux submit is successful. The submitted job itself will fail since sleep 1 sleep 2 flux jobs -a... is being submitted.

from flux-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.