Open 6palace opened 7 years ago
@6palace can you post a minimal reproduction at all?
I haven't been able to localize the error yet, since it's so particular, so not immediately. The project is not open source, but I might be able to isolate it down to a subset of source code and send you that to reproduce. Would that be okay?
That's better than nothing :)
A few shots in the dark: Do you have a setup function in your tests? Are you using test-fixture?
Yes, we do use test-fixture, our setup creates a sinon fakeserver as well as the createFixture command.
Also, a little more digging: our wct config points towards a test index that loadSuites all our individual element tests. The number of suites being loaded in affects whether the failure manifests, so I don't think I'll be able to narrow the source code.
The whole thing feels like a performance problem to me, maybe our polymer elements are getting too complicated? We are doing a lot of element nesting, could that cause this sort of error?
Hi @justinfagnani, so I've managed to get around this error in two ways.
Refactoring of the tested element. I moved the biggest nested element into a slot instead of being directly in the parent element. That element is being tested separately. This suggests that the error is performance-related.
Our tested element calls a refresh on the attached hook, which initiates an ajax call that in our tests is caught and returned by sinon. When I switched this refresh to happen on an observer instead, and then manually called it in the tests before the failing flush function, the error does not show up. Possibly this means there's some timing confusion between the first flush and the attached handler?
We can close the issue, but bug is still hidden somewhere, so your choice.
Incidentally, (maybe a separate issue) when a test fails in the beforeEach call in using wct command, the failures do not show up in the test results, my only indication is in the lowered test coverage. Is there a way around this?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
We execute tests on some polymer elements both using command line wct and directly as html files. Recently, without significant changes in source or test code, we are getting a polymer error on the flush command. Stacktrace here:
The error shows up only on one test in the suite, even though all tests use the flush function, and all subsequent tests pass. Also, the failure is not test-specific: commenting out the failing test results in the next test failing instead, and then all other tests in the suite passing.
This error furthermore only shows up when running tests in command line, and does not occur when loading test.html directly. It is looking very mysterious to me, thanks for the help!