i using "google.golang.org/appengine/aetest" package , setup testmain this:
var myaeinst aetest.instance func testmain(m *testing.m) { var err error myaeinst, err = aetest.newinstance(&aetest.options{stronglyconsistentdatastore: true}) defer teardown() c := m.run() os.exit(code) } func teardown() { if myaeinst != nil { myaeinst.close() } }
but stuck @ aetest.newinstance, 1 encounter similar issue?
you're calling defer teardown()
, os.exit(code)
, calls teardown
after os.exit
(i.e., never). need either explicitly call teardown
before os.exit
, or make new function defer doesn't call os.exit
.
Comments
Post a Comment