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

ScalaTest fails to fail in Firefox and Chrome #44

Closed
gshakhn opened this issue Apr 16, 2016 · 6 comments
Closed

ScalaTest fails to fail in Firefox and Chrome #44

gshakhn opened this issue Apr 16, 2016 · 6 comments
Labels
Milestone

Comments

@gshakhn
Copy link
Contributor

gshakhn commented Apr 16, 2016

Not sure if this is a ScalaTest bug or a scala-js-env-selenium bug, but a failing test fails to report the failure to sbt. Therefore the build passes when it shouldn't.

Minimal project is available at gshakhn/scalajs-selenium-scalatest-failure

gshakhn added a commit to gshakhn/private-wiki that referenced this issue Apr 16, 2016
Partially based on http://japgolly.blogspot.com/2016/03/scalajs-firefox-chrome-sbt.html.

Currently not running Chrome in Travis due to
scala-js/scala-js-env-selenium#44. It won't fail the build
appropriately.
I can get Firefox to fail successfully in this project though. Not sure
why the minimal reproduction case is different.
@nicolasstucki
Copy link
Contributor

When debugging the minimal case I found issue #47, which might be producing this bug. But in that case the fails are only in Chrome and they do report the failure to SBT.

@nicolasstucki
Copy link
Contributor

@gshakhn have you tried using parallelExecution in Test := false?

@gshakhn
Copy link
Contributor Author

gshakhn commented Apr 19, 2016

@nicolasstucki Just tried that in gshakhn/scalajs-selenium-scalatest-failure@3e31364. It still fails to fail on my machine. Does it work on yours?

For what it's worth, the original bug I hit was only in Chrome. It reported the Firefox failures to SBT appropriately, failing the build correctly. Not sure why the simplified example fails in both browsers.

gshakhn added a commit to gshakhn/scalajs-selenium-scalatest-failure that referenced this issue Apr 19, 2016
* Get rid of uTest. It wasn't needed for the failing example. Was
there just to prove that uTest worked.
* Disable `parallelExecution` based on feedback from @nicolasstucki
on scala-js/scala-js-env-selenium#44
@nicolasstucki
Copy link
Contributor

Found the source of the issue, it is in the ScalaTest custom StackDepthExceptionHelper for Scala.js. In the method StackDepthExceptionHelper.getStackDepth there are some accesses stackTraces: Array[StackTraceElement] that can be out of bounds.

@nicolasstucki
Copy link
Contributor

@gshakhn you should report this issue on the ScalaTest issue list.
The key part of the exception is the TypeError: stackTraces.u[((depth1 + 3) | 0)] is undefined which implies that one of the stackTraces(depth1 + 3) array accesses in StackDepthExceptionHelper.getStackDepth is out of bounds.

@jatcwang
Copy link

jatcwang commented Jun 9, 2016

I think I am hitting the same issue as well when one of my tests fails in Scalatest, running on node. Just commenting here so all the info is in one thread instead of two.

scala.scalajs.js.JavaScriptException:
[info]   at org.scalatest.exceptions.StackDepthExceptionHelper$.getFailedCodeFileName(/home/.../js/target/scala-2.11/https:/raw.githubusercontent.com/scalatest/scalatest/v3.0.0-M15/scalatest.js/src/main/scala/org/scalatest/exceptions/StackDepthExceptionHelper.scala:44:85)
[info]   at org.scalatest.exceptions.StackDepth$class.failedCodeFileName(/home/.../js/target/scala-2.11/https:/raw.githubusercontent.com/scalatest/scalatest/v3.0.0-M15/scalatest.js/target/scala-2.11/src_managed/main/scala/org/scalatest/exceptions/StackDepth.scala:77:91)

@gzm0 gzm0 modified the milestone: v0.1.x Aug 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants