Comcast / plax

A test automation engine for messaging systems
Apache License 2.0
7 stars 14 forks source link

Max attempts ignored when guard exists #145

Open jsccast opened 2 years ago

jsccast commented 2 years ago

Example:

spec:
  phases:
    phase1:
      steps:
        - pub:
            chan: mother
            payload:
              make:
                name: shell
                type: cmd
                config:
                  command: bash
        - recv:
            chan: mother
            pattern:
              success: true
        - pub:
            payload: |
              echo '{"statuscode":200,"body":{"activities":1}}'
        - recv:
            chan: shell
            attempts: 1
            pattern:
              statuscode: 200
              body:
                activities: "?activities"
            guard: |
              return bindings["?activities"] >= 2;

This test should fail (without timing out). Instead it hangs. If the guard is removed (and the recv body is altered to prevent a match), the test fails immediately as it should.

jsccast commented 2 years ago

Shockingly #109 seems to fix this bug, but #109 is somewhat scary.