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

Fix crash in relation reference test #34818

Merged
merged 1 commit into from Mar 4, 2020

Conversation

troopa81
Copy link
Contributor

@troopa81 troopa81 commented Mar 2, 2020

Description

Fix flaky test in relation reference widget test.

QgsFeatureFilterModel needs to wait for the mGatherer to be complety finished. Even if the collectedValues signal emitting is the last instruction, there is no garantie run is over when we delete it (I can reproduce the issue every time by adding a sleep just after the signal emitting).

@troopa81 troopa81 added Bug Either a bug report, or a bug fix. Let's hope for the latter! backport release-3_10 labels Mar 2, 2020
@troopa81 troopa81 changed the title Fixes #34779 crash in testrelationreference test Fix crash in relation reference test Mar 2, 2020
@elpaso
Copy link
Contributor

elpaso commented Mar 2, 2020

Just hit this one myself, I believe the source of the issue was f39f5db#diff-bee409cb02c75d3272f877c88ea1e86eR345

@troopa81
Copy link
Contributor Author

troopa81 commented Mar 3, 2020

@elpaso Thanks for noticing.

@obrix Is the fix looks fine to you?

@obrix
Copy link

obrix commented Mar 3, 2020

@troopa81 Thanks for this one. I was trying to fix a crash in updateCompleter (see #34581 ), It made the situation a bit better but it still did not fix the issue completely. Maybe your commit will fix this once and for all. Still not convinced that everything make sense in the way the thread is handled here though.

@troopa81 troopa81 changed the title Fix crash in relation reference test [WIP] Fix crash in relation reference test Mar 3, 2020
@troopa81
Copy link
Contributor Author

troopa81 commented Mar 3, 2020

We have a talk with @obrix on the subjet.

We think the first issue was not due to a signal order but because of the latency between the emitting of collectedValues and finished signal. As a consequence, updateCompleter could have triggered another reload and created another mGatherer object while the finished signal was not emitted and received yet. This ends in mGatherer being deleted while updateCompleter needs it.

The fix of @obrix fix this and this PR adds a wait to be sure the thread is completely finished. So it should be fine now.

@troopa81 troopa81 changed the title [WIP] Fix crash in relation reference test Fix crash in relation reference test Mar 3, 2020
@elpaso elpaso merged commit fa6958f into qgis:master Mar 4, 2020
@qgis-bot
Copy link
Collaborator

qgis-bot commented Mar 4, 2020

The backport to release-3_10 failed:

The process 'git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release-3_10 release-3_10
# Navigate to the new working tree
cd .worktrees/backport-release-3_10
# Create a new branch
git switch --create backport-34818-to-release-3_10
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick fa6958fb650fb7fc6eac81be97c57391fd9def69
# Push it to GitHub
git push --set-upstream origin backport-34818-to-release-3_10
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release-3_10

Then, create a pull request where the base branch is release-3_10 and the compare/head branch is backport-34818-to-release-3_10.

@qgis-bot
Copy link
Collaborator

qgis-bot commented Mar 4, 2020

The backport to release-3_12 failed:

The process 'git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release-3_12 release-3_12
# Navigate to the new working tree
cd .worktrees/backport-release-3_12
# Create a new branch
git switch --create backport-34818-to-release-3_12
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick fa6958fb650fb7fc6eac81be97c57391fd9def69
# Push it to GitHub
git push --set-upstream origin backport-34818-to-release-3_12
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release-3_12

Then, create a pull request where the base branch is release-3_12 and the compare/head branch is backport-34818-to-release-3_12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants