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

Fixed threading issue in Biosphere patcher #1200

Merged
merged 3 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion activity_browser/ui/widgets/dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ def __init__(self, version, parent=None):
self.biosphere_thread.start()

# finally, check if patches are available for this version and apply them
self.check_patches()
#self.biosphere_thread.finished.connect(self.check_patches)

@Slot(int, str, name='updateThread')
def update_progress(self, current: int, text: str) -> None:
Expand All @@ -534,6 +534,7 @@ def update_progress(self, current: int, text: str) -> None:
def finished(self, result: int = None) -> None:
self.biosphere_thread.exit(result or 0)
self.setValue(3)
self.check_patches()
signals.change_project.emit(bw.projects.current)
signals.project_selected.emit()

Expand Down
4 changes: 4 additions & 0 deletions tests/test_add_default_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ def test_add_default_data(qtbot, ab_app, monkeypatch):
QtCore.Qt.LeftButton
)

# The biosphere3 update finishes with a 'database_changed' signal.
with qtbot.waitSignal(signals.database_changed, timeout=2 * 60 * 1000): # allow 2 mins for biosphere update
pass

# biosphere was installed
assert 'biosphere3' in bw.databases

Expand Down