Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider Phase Event as a parallel non-interruptive event #87

Open
baubakg opened this issue Aug 19, 2022 · 4 comments
Open

Consider Phase Event as a parallel non-interruptive event #87

baubakg opened this issue Aug 19, 2022 · 4 comments
Labels
enhancement New feature or request
Milestone

Comments

@baubakg
Copy link
Member

baubakg commented Aug 19, 2022

We should consider the possibility of executing a non-inerruptive parallel event. For an even X and a scenario:

A-> B -> C

The Phase event X should happen:
A(X) -> B -> C
A -> B(X) -> C
A -> B -> C(X)

@baubakg baubakg added the enhancement New feature or request label Aug 19, 2022
@baubakg baubakg changed the title Consider Phase Even as a parallel non-interruptive event Consider Phase Event as a parallel non-interruptive event Aug 22, 2022
@baubakg baubakg added this to To do in Non interruptive events via automation Aug 22, 2022
@baubakg
Copy link
Member Author

baubakg commented Aug 24, 2022

Introduce phase chaos

@baubakg
Copy link
Member Author

baubakg commented Sep 3, 2022

We can have three modes of execution.

  • in between (between steps)
  • during (during a step)
  • both
    Where do we define this?

(in the cas of parallel events, when executing between steps, it works as serial)

The event to be executed is either on test level or suite level

All phased tests can be subject to non-interruptive events. (the events follow the rules for shuffled and non-shuffled)

Execution (two possibilities) :

  • add a new phase type
  • add an execution option

The non-interruptive event can be specific to a scenario or be set globally.

A scenario subject to interruptive events can also be subject to non-interruptive events as well. This means that a scenario that is wrapped around a non-interruptive event at one go can also be wraped around an interruptive event as well. However this may not be simultaneous; I.e. a scenario cannot be subject to both interruptive and non-interruptive events.

This means that we may have two separate executions. One for interruptive events and one for non-interruptive ones.
However, can a scenario be executed as both non-phased and interruptive? Answer: NO

  • Add a new phase called Non-interruptive.
  • add property non-interruptive event
  • add property nip-mode (between, during, both)

A parallel event needs to start before a step and finish after (before starting the next). Otherwise we cannot map an action/step to an event and a problem.

We need link a list of events to a step-pg.

In the end we need to repeat the scenario = nr of steps.

@baubakg
Copy link
Member Author

baubakg commented Sep 9, 2022

Examples

  1. A scenario that allows for a specific Non-interruptive class / method. If set it overrides the passed non-interruptive events:
Class InterruptiveEvents {
  //restartProductServer
  public void event1() {
  }

  //restartDatabaseServer
  public void event2() {
  }
}

@PhasedTest(canShuffle = true,  interruptedBy=InterruptiveEvents.class, interruptionModel="during")
@Test
public void class MyPhasedTest {

      public void step1(String val) {  
      }

      public void step2(String val) {  
      }

      public void step3(String val) {  
      }
}

When run the standard phase groups are multiplie by the number of event types. In the example above, we will normally have 4 phase groups (0-3, 1-2, 2-1, 3-0), however with the events, we get:

  • event1_0-3
  • event1_1-2
  • event1_2-1
  • event1_3-0
  • event2_0-3
  • event2_1-2
  • event2_2-1
  • event2_3-0

Note to self when we are in a "during" event maybe the 0-3,3-0 may be irrelevant.

Scenario level configurations, override the global configurations

@baubakg baubakg added this to the 8.0.0 milestone Dec 3, 2022
@baubakg baubakg moved this from To do to In progress in Non interruptive events Dec 4, 2022
@baubakg
Copy link
Member Author

baubakg commented Dec 4, 2022

Ok we have the following cases:

NR Phase Execution Mode Split Shuffle
1 PRODUCER/CONSUMER SHUFFLED true true
2 PRODUCER/CONSUMER Single true false
3 NON_PHASED N/A false false
4 ASYNCHRONOUS Single false false
5 ASYNCHRONOUS SHUFFLED false true

@baubakg baubakg moved this from In progress to Done in Non interruptive events Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

1 participant