tg.grepStderrNot("duplicate loads of", "did not remove old packages from cache")
}
+// Issue 17119 more duplicate load errors
+func TestIssue17119(t *testing.T) {
+ testenv.MustHaveExternalNetwork(t)
+
+ tg := testgo(t)
+ defer tg.cleanup()
+ tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata"))
+ tg.runFail("build", "dupload")
+ tg.grepBothNot("duplicate load|internal error", "internal error")
+}
+
func TestFatalInBenchmarkCauseNonZeroExitStatus(t *testing.T) {
tg := testgo(t)
defer tg.cleanup()
// Build list of imported packages and full dependency list.
imports := make([]*Package, 0, len(p.Imports))
deps := make(map[string]*Package)
+ save := func(path string, p1 *Package) {
+ // The same import path could produce an error or not,
+ // depending on what tries to import it.
+ // Prefer to record entries with errors, so we can report them.
+ if deps[path] == nil || p1.Error != nil {
+ deps[path] = p1
+ }
+ }
+
for i, path := range importPaths {
if path == "C" {
continue
if i < len(p.Imports) {
p.Imports[i] = path
}
- deps[path] = p1
+
+ save(path, p1)
imports = append(imports, p1)
for _, dep := range p1.deps {
- // The same import path could produce an error or not,
- // depending on what tries to import it.
- // Prefer to record entries with errors, so we can report them.
- if deps[dep.ImportPath] == nil || dep.Error != nil {
- deps[dep.ImportPath] = dep
- }
+ save(dep.ImportPath, dep)
}
if p1.Incomplete {
p.Incomplete = true