-
-
Notifications
You must be signed in to change notification settings - Fork 427
QCoreApplication::postEvent: Unexpected null receiver #39
Comments
These are hard to track down. They happen when we try to send an event to an object we already deleted. In capybara-webkit, this is usually when a Command subclass receives an event after it's deleted. The best way I know of to track them down is to use print debugging to figure out what the socket dialog looks like that causes the error. |
Putting an |
Is there a good way to reproduce this? Can you write a test? |
Well a couple of days ago I first noticed the bug. So I did some digging and I didn't find out why |
Right; I need to know what actually causes this issue, though. Adding that if statement will only mask the symptom and not fix the problem, because it shouldn't be trying to delete a NULL command in the first place. I think the most likely culprit is that a command is emitting a response twice, which shouldn't happen. |
This error pops up for me every once and a while. I'm trying to use
And it fails with the following error:
My step that produces the error, looks like this:
It blows up on the |
I found a couple possible paths that led to this error and fixed them. Can you guys try again with 0.3.0? |
I'm going to assume this is fixed unless somebody else runs into it. |
I was experiencing this but as of 0.4.1 I'm not anymore. |
Still getting the error with 0.5.0 cannot select option, no option with text 'Call To Action' in select box 'Select the type of component' (Capybara::ElementNotFound) (A couple of steps after the 'QCoreApplication::postEvent: Unexpected null receiver' gets printed. If the postEvent error doesn't happen, the feature passes) What debug info would be most useful here to work out what's going on? |
This is happening for me on the 1.0 branch when I try to run any javascript. |
I'm still getting this. Just experienced it on 0.4.0. |
Still an issue for me. I noticed that when I do run into this problem, it happens on almost all tests in the suite. When it doesn't occur, it happens on none of them. It's also quite sporadic and unpredictable, occurring sometimes on a test that has previously passed and is unchanged. Sometimes I receive this corresponding error: |
Just out of interest, can you run your HTML through some sort of validator? |
I get this unpredictable error message as well, using 0.5.0 . |
Firstly, many thanks to the authors and maintainers of this gem for saving me from Selenium hell and making it possible for me to do awesome things. <3 Secondly, please reopen this issue. This bug is still present, and it's evil. I just spent hours and hours tracking it down. In rare instances, it looks like WebKit is dispatching the pageFinished() signal twice (maybe when a redirect happens, under some conditions?). Possibly a WebKit bug? Anyway, webkit_server doesn't expect this to happen, so this is what's happening:
Suggested fixes:
While I am 99% certain that my analysis is correct, this bug is so hard to reproduce that I can't actually test the fix. I will run this under load in production for a while and hopefully there are no recurrences! |
I've been running with this fix continuously for about 6 hours now. The "QCoreApplication::postEvent: Unexpected null receiver" error has not reared its ugly head, I and I have observed no regressions. |
+1 |
1 similar comment
+1 |
Also, thanks for the suggestions as to how to improve capybara-wekbit. I'm working on some things that will make issues like this easier to debug. I think it's worth explaining that capybara-wekbit doesn't execute multiple commands at once. It holds onto a command name and arguments because it doesn't necessarily get these all at once from the connection. Once we've gotten them all, we build a command and discard the command name. If we receive a new command and the browser is busy loading a page for some reason (possibly because of setTimeout or another asynchronous load), we wait until the page is finished loading to run the new command. Because most pages are loaded asynchronously, this can lead to the appearance that more than one command is running at once. However, that's never the case. |
I don't think I can justify the additional investment into building some complicated test jig to reliably trigger a race condition, so someone else will have to take up the torch. |
Thanks, @bwbuchanan. I released 0.7.1 with your fix. If anybody runs into this again, please create a new issue and attach a debug log. Check out this page for information on generating a good debug log: https://github.com/thoughtbot/capybara-webkit/wiki/Reporting-Crashes |
Getting this message popping up in 2 different cucumber test suits, not sure where it's coming from. Any ideas?
The text was updated successfully, but these errors were encountered: