Skip to content

Commit

Permalink
QE-10912 swap multiproc libraries (#504)
Browse files Browse the repository at this point in the history
- change - swap pebble for mpire, kill procs on run timeout

---------

Co-authored-by: Xin Dong <[email protected]>
  • Loading branch information
ddl-cedricyoung and ddl-xin authored Jul 25, 2024
1 parent faf8a16 commit ddceed2
Show file tree
Hide file tree
Showing 11 changed files with 224 additions and 96 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,6 @@ terraform.rc

# VSCode
.vscode

# generated during test run
skip_first_scenario.txt
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project closely adheres to [Semantic Versioning](https://semver.org/spe
- chore - configure renovate
- chore - remove dependabot config (duplicates renovate)
- chore - remove safety (duplicates sonarqube)
- change - swap pebble for mpire, kill procs on run timeout

## 0.197.0
- Fix - before all hooks are now executed
Expand Down
4 changes: 4 additions & 0 deletions data/features/slow_features/slow_feature4.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Feature: Slow feature #4

Scenario: Slow scenario
Given I sleep for "5" seconds
4 changes: 4 additions & 0 deletions data/features/slow_features/slow_feature5.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Feature: Slow feature #5

Scenario: Slow scenario
Given I sleep for "5" seconds
1 change: 1 addition & 0 deletions features/cli/config.feature
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Feature: Config
[\s\S]*
"""

@workers
Scenario: User can load cucurc values from cucurc files at various levels when using workers
Given I create a file at "{CUCU_RESULTS_DIR}/load_nested_cucurc_with_workers/environment.py" with the following:
"""
Expand Down
11 changes: 5 additions & 6 deletions features/cli/run.feature
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,23 @@ Feature: Run
@runtime-timeout
Scenario: User can run with a runtime timeout and exit without having hit the timeout
Given I run the command "cucu run data/features/echo.feature --runtime-timeout 300 --results {CUCU_RESULTS_DIR}/runtime_timeout_results" and save stdout to "STDOUT" and expect exit code "0"
Then I should see the previous step took less than "8" seconds
And I should see "{STDOUT}" does not contain the following:
Then I should see "{STDOUT}" does not contain the following:
"""
runtime timeout reached, aborting run
"""

@runtime-timeout @workers
Scenario: User can run with a runtime timeout and workers and exit without having hit the timeout
Given I run the command "cucu run data/features/tagged_features --workers 2 --runtime-timeout 300 --results {CUCU_RESULTS_DIR}/runtime_timeout_with_workers_results" and save stdout to "STDOUT" and expect exit code "0"
Then I should see the previous step took less than "8" seconds
And I should see "{STDOUT}" does not contain the following:
Then I should see "{STDOUT}" does not contain the following:
"""
runtime timeout reached, aborting run
"""
@runtime-timeout @workers
Scenario: User can run with a runtime timeout and workers to avoid running over a certain amount of time
Given I run the command "cucu run data/features/slow_features --workers 2 --runtime-timeout 10 --results {CUCU_RESULTS_DIR}/runtime_timeout_with_workers_timed_out_results" and save stdout to "STDOUT" and expect exit code "1"
Then I should see the previous step took less than "12" seconds
# add 14s as multiprocess overhead cost
Then I should see the previous step took less than "25" seconds
And I should see "{STDOUT}" contains the following:
"""
runtime timeout reached, aborting run
Expand All @@ -108,6 +107,6 @@ Feature: Run
Then I should see "{STDOUT}" matches the following
"""
[\s\S]*
.*Task timeout.*3.0.*
.*task timed out.*timeout=3.0.*
[\s\S]*
"""
12 changes: 6 additions & 6 deletions features/cli/run_with_workers.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ Feature: Run with workers

Scenario: User can parallelize a slow set of tests and speedup execution
Given I run the command "cucu run data/features/slow_features --results {CUCU_RESULTS_DIR}/slow_features_without_workers" and expect exit code "0"
Then I should see the previous step took more than "15" seconds
When I run the command "cucu run data/features/slow_features --workers 3 --results {CUCU_RESULTS_DIR}/slow_features_with_workers" and expect exit code "0"
Then I should see the previous step took less than "14" seconds
Then I should see the previous step took more than "25" seconds
When I run the command "cucu run data/features/slow_features --workers 5 --results {CUCU_RESULTS_DIR}/slow_features_with_workers" and expect exit code "0"
Then I should see the previous step took less than "25" seconds

Scenario: User gets a report even when running with workesr
Given I run the command "cucu run data/features/slow_features --workers 3 --generate-report --report {CUCU_RESULTS_DIR}/generate_report_with_workers_report --results {CUCU_RESULTS_DIR}/generate_report_with_workers_results" and expect exit code "0"
Given I run the command "cucu run data/features/slow_features --workers 4 --generate-report --report {CUCU_RESULTS_DIR}/generate_report_with_workers_report --results {CUCU_RESULTS_DIR}/generate_report_with_workers_results" and expect exit code "0"
Then I should see a file at "{CUCU_RESULTS_DIR}/generate_report_with_workers_report/index.html"

Scenario: User gets only dots in the output when running with workers
Given I run the command "cucu run data/features/slow_features --workers 2 --results {CUCU_RESULTS_DIR}/dots_in_report_with_workers_results" and save stdout to "STDOUT" and expect exit code "0"
Given I run the command "cucu run data/features/slow_features --workers 3 --results {CUCU_RESULTS_DIR}/dots_in_report_with_workers_results" and save stdout to "STDOUT" and expect exit code "0"
Then I should see "{STDOUT}" is equal to the following:
"""
...
.....
"""

Scenario: User gets progress even when a step is in a retry() block
Expand Down
Loading

0 comments on commit ddceed2

Please sign in to comment.