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

Dgo test issues #27

Open
Julian-Mentasti opened this issue Nov 3, 2020 · 3 comments
Open

Dgo test issues #27

Julian-Mentasti opened this issue Nov 3, 2020 · 3 comments
Assignees

Comments

@Julian-Mentasti
Copy link

Whenever you run dgo test it will execute the tests but the goroutine will never terminate. I'm unable to kill the process ether.

This might become important when you are testing projects that don't produce binaries.

@Julian-Mentasti Julian-Mentasti changed the title Dgo test never terminates Dgo test issues Dec 7, 2020
@Julian-Mentasti
Copy link
Author

Julian-Mentasti commented Dec 7, 2020

Some simple library tests such as gorilla/websocket do terminate when you run dgo test independently of overlord. Otherwise if you run dgo test though overlord the processes won't terminate.

julian@caboose-ubuntu:~/go/src/github.com/gorilla/websocket$ go test
PASS
ok  	github.com/gorilla/websocket	0.133s
julian@caboose-ubuntu:~/go/src/github.com/gorilla/websocket$ dgo test
PASS
ok  	github.com/gorilla/websocket	0.111s

Oftentimes these test need to be grouped together to make sure other packages and imports are included so its paramount that dgo test works instead of limiting functionality to dgo test [filename].

julian@caboose-ubuntu:~/go/src/github.com/gorilla/websocket$ go test -v server_test.go 
# command-line-arguments [command-line-arguments.test]
./server_test.go:32:16: undefined: Subprotocols
./server_test.go:50:9: undefined: IsWebSocketUpgrade
./server_test.go:68:9: undefined: checkSameOrigin
./server_test.go:81:9: undefined: fakeNetConn
./server_test.go:99:15: undefined: Upgrader
./server_test.go:114:15: undefined: bufioWriterBuffer
FAIL	command-line-arguments [build failed]
FAIL

In order to achieve this we need a way to instrument multiple files at the same time, this can be configured using the "dir" property on the "instr" section of the config json.

@Julian-Mentasti Julian-Mentasti self-assigned this Dec 7, 2020
@Julian-Mentasti
Copy link
Author

Julian-Mentasti commented Dec 8, 2020

I was able to run dgo test using overlord using the following configuration:

websocket.json config:

{
    "exec" : {
        "path" : "/home/julian/go/src/github.com/gorilla/websocket/server_test.go",
        "size" : "400M",
        "processes" : 1,
        "sched" : "Schedule.json",
        "loglevel" : "FATAL",
        "blocks_file" : "../examples/websocket/blocks",
        "maxruns" : 50,
        "strategy" : "random",
	"build": {
		"build_path" : "../../../gorilla/websocket/dgo_build",
		"run_path" : "dgo_run"
	}
    },
    "instr" : {
        "dir" : "/home/julian/go/src/github.com/gorilla/websocket/",
        "blocks_file" : "../examples/websocket/blocks"
    },
    "bench" : {
        "path" : "stats.csv",
        "iter" : 1
    }
}

The "instr" "dir" line makes sure the entire library is instrumented.

The "run_path" points to this bash file:

#!/bin/bash

cd /home/julian/go/src/github.com/gorilla/websocket

dgo test

and "build_path" points to this file:

#!/bin/bash

cd /home/julian/go/src/github.com/gorilla/websocket

dgo build

Building a library will produce no binary so the file above only fulfills a requirement from overlord but does nothing else.

When you run overlord in instrumentation mode using the above config file you will see something like this:

julian@caboose-ubuntu:~/go/src/github.com/DARA-Project/GoDist-Scheduler/overlord$ sudo -E dgo run overlord.go -mode=explore -optFile=configs/websocket.json
[sudo] password for julian: 
2020/12/08 11:52:19 Copying exec script from /home/julian/go/src/github.com/DARA-Project/GoDist-Scheduler/overlord  to  /home/julian/go/src/github.com/gorilla/websocket
1+0 records in
1+0 records out
419430400 bytes (419 MB, 400 MiB) copied, 0.245387 s, 1.7 GB/s
[Overlord]overlord.go:312: Finished building using build script
[Scheduler]scheduler.go:123: Exploring
[GoRuntime]Setting debug level to 3
fatal error: logging entries exceeded MAXLOGENTRIES, either modify dara/const.go or log less OwO
.... more logging errors

This will spawn a dgo run overlord.go thread that will continue running. Using ^C will send a SIGINT to the thread but this will not terminate it.

The thread is owned the root user so you will be unable to kill the thread though top or other process monitoring software unless you're running as root. The easiest way to terminate them is to use sudo kill -9 [PID]. NOTE running multiple explorations will spawn multiple threads that will each eat up an entire core, possibly starving your computer.

@Julian-Mentasti
Copy link
Author

It appears the scheduler/GoDist is unable to recognise and control the processes spawned by dgo test so it cannot do any reordering. The dgo test threads themselves terminate but the dgo run overlord.go will not, and leaving the overlord thread idling for an hour will not it to naturally terminate ether.

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

1 participant