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

Reported duration time of scenario is about 0ms on Android #3

Closed
aslakhellesoy opened this issue Jul 5, 2018 · 8 comments
Closed

Comments

@aslakhellesoy
Copy link
Contributor

From @lsuski on July 5, 2018 18:7

Hi,
I've recently build locally cucumber 4.0.0-SNAPSHOT and tried it on Android and encounter issue with scenario duration time. For most of scenarios it is about 0ms or 25ms or 75ms so generally it is very short but test takes naturally longer. With Cucumber 2.4.0 execution time is normal (average 2s per scenario). I was digging whole day in code base but could not find any reason for that.
Was there any change between 2.4.0 and 4.0.0-SNAPSHOT which could introduce such issue on Android?

Copied from original issue: cucumber/cucumber-jvm#1413

@aslakhellesoy
Copy link
Contributor Author

From @mpkorstanje on July 5, 2018 18:32

If you can tell me where the time is reported I might be able to help.

@lsuski
Copy link
Contributor

lsuski commented Jul 5, 2018

I mean the time shown in Android Studio test execution tab on the right of scenario name

@mpkorstanje
Copy link
Contributor

Sure. But where does that time come from?

@mpkorstanje
Copy link
Contributor

mpkorstanje commented Jul 5, 2018

We did stop using XStream in 3.x for our transformations. That might have something to do with it, XStream involved quite a bit of class path scanning/reflection. Both are slow operations on Android I believe.

@mpkorstanje
Copy link
Contributor

Does it add up wit the reported durations in logcat?

@lsuski
Copy link
Contributor

lsuski commented Jul 5, 2018

I'll check tomorrow, but execution time is slower than reported, it takes about 2 s per scenario but reported in Android Studio is 0ms. I have no idea where does that time come from. I thought it is reported to Instrumentation but it is not and it wasn't as well in 2.4.0. The only place where duration from Result is taken into account is Stats

@lsuski
Copy link
Contributor

lsuski commented Jul 5, 2018

There is cucumber.api.event.TestCaseFinished class which holds cucumber.api.Result with duration. But I can't find a place where this duration is used except Stats and some formatters but it was the same in 2.4.0 and durations were accurate then. So there is some magic from which Intellij/AS is taking those duration but I'm lack of ideas currently.

@lsuski
Copy link
Contributor

lsuski commented Sep 28, 2018

fixed by 2ed7777

@lsuski lsuski closed this as completed Sep 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants