Skip to content

Commit

Permalink
fix: resolve pabot issue with duplicated test runs and incomplete exe…
Browse files Browse the repository at this point in the history
…cutions

Addressed a problem in Pabot where test runs could be duplicated or test executions might not complete properly in specific scenarios.
  • Loading branch information
gibiw committed Dec 4, 2024
1 parent 0ac2f2d commit 0cf35de
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
8 changes: 8 additions & 0 deletions qase-robotframework/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# qase-robotframework 3.2.3

## What's new

Fixed an issue with Pabot
Resolved an issue where test runs were sometimes duplicated or test executions failed to complete under certain
conditions.

# qase-robotframework 3.2.2

## What's new
Expand Down
2 changes: 1 addition & 1 deletion qase-robotframework/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "qase-robotframework"
version = "3.2.2"
version = "3.2.3"
description = "Qase Robot Framework Plugin"
readme = "README.md"
authors = [{name = "Qase Team", email = "[email protected]"}]
Expand Down
10 changes: 8 additions & 2 deletions qase-robotframework/src/qase/robotframework/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ def get_pool_id():
return BuiltIn().get_variable_value('${PABOTQUEUEINDEX}', None)


def get_last_level_flag():
return BuiltIn().get_variable_value('${PABOTISLASTEXECUTIONINPOOL}', None)


class Listener:
ROBOT_LISTENER_API_VERSION = 3

Expand All @@ -34,6 +38,7 @@ def __init__(self):
self.runtime = QaseRuntimeSingleton.get_instance()
self.tests = {}
self.pabot_index = None
self.last_level_flag = None

if config.config.debug:
logger.setLevel(logging.DEBUG)
Expand All @@ -46,6 +51,7 @@ def __init__(self):

def start_suite(self, suite, result):
self.pabot_index = get_pool_id()
self.last_level_flag = get_last_level_flag()
if self.pabot_index is not None:
try:
if int(self.pabot_index) == 0:
Expand Down Expand Up @@ -134,8 +140,8 @@ def end_test(self, test, result):
)

def close(self):
if self.pabot_index is not None:
if int(self.pabot_index) == 0:
if self.last_level_flag is not None:
if int(self.last_level_flag) == 1:
Listener.drop_run_id()
else:
self.reporter.complete_worker()
Expand Down

0 comments on commit 0cf35de

Please sign in to comment.