Skip to content

gopherjs test fails #395

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

Closed
dave opened this issue Feb 10, 2016 · 6 comments
Closed

gopherjs test fails #395

dave opened this issue Feb 10, 2016 · 6 comments

Comments

@dave
Copy link
Contributor

dave commented Feb 10, 2016

GopherJS: 0faf2ef
Node: node/5.6.0
Go: go version go1.5.1 darwin/amd64

Given the following project:

gotest.go:

package jstest

gotest_test.go

package jstest

import "testing"

func TestNil(t *testing.T) {

}

... running gopherjs test produces an error:

$ gopherjs test
gopherjs: Source maps disabled. Use Node.js 4.x with source-map-support module for nice stack traces.
PASS
fatal error: all goroutines are asleep - deadlock!
FAIL    github.com/davelondon/jstest    0.359s

Of course go test passes:

$ go test
PASS
ok      github.com/davelondon/jstest    0.008s
@dmitshur
Copy link
Member

Hi, thanks for reporting this.

However, I'm unable to reproduce. gopherjs test works as expected for that input:

$ go test
PASS
ok      github.com/shurcooL/play/31 0.018s
$ gopherjs test
gopherjs: Source maps disabled. Use Node.js 4.x with source-map-support module for nice stack traces.
PASS
ok      _/Users/Dmitri/Go/src/github.com/shurcooL/play/310.504s
$ gopherjs test -v
gopherjs: Source maps disabled. Use Node.js 4.x with source-map-support module for nice stack traces.
=== RUN   TestNil
--- PASS: TestNil (0.00s)
PASS
ok      _/Users/Dmitri/Go/src/github.com/shurcooL/play/310.503s
$ ls
gotest.go   gotest_test.go
$ cat gotest.go 
package jstest
$ cat gotest_test.go 
package jstest

import "testing"

func TestNil(t *testing.T) {

}

Using:

go version go1.5.3 darwin/amd64
GopherJS version 0faf2ef97c0ada75462340a914f01fec80521216

@dave
Copy link
Contributor Author

dave commented Feb 10, 2016

Yes I can't reproduce it in a docker container. I'll see if there's something wrong with the setup of my Mac.

@dave
Copy link
Contributor Author

dave commented Feb 10, 2016

OK, this is what I've done:

Rebooted Mac
Deleted $GOPATH/src, $GOPATH/bin, $GOPATH/pkg
Upgraded Go to 1.5.3
Downgraded Node to 4.3.0
go get github.com/gopherjs/gopherjs
go get github.com/davelondon/jstest

Still has the same error. Can you think of anything else to try?

@dave
Copy link
Contributor Author

dave commented Feb 10, 2016

I'll close this issue and continue trying to resolve this myself. I'll post again here when I find the solution.

@dave dave closed this as completed Feb 10, 2016
@nullstyle
Copy link
Contributor

I'm seeing this as well using 00f306e, and node 6.6.0

@nullstyle
Copy link
Contributor

nullstyle@8d4d6d0 illustrates a hackish workaround I did to resolve the issue for me. I don't yet know enough about the internals of gopherjs to find the correct way to solve the underlying os.Exit() error.

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