test-infra: Sidecar censoring tests do not pass locally.

What happened:

INFO: From Testing //prow/sidecar:go_default_test:
==================== Test output for //prow/sidecar:go_default_test:
--- FAIL: TestArchiveMatchesTar (0.00s)
    censor_test.go:170: failed to archive input: could not walk source files to archive them: could not tar file: archive/tar: write too long
--- FAIL: TestRoundTrip (0.00s)
    censor_test.go:213: failed to archive input: could not walk source files to archive them: could not tar file: archive/tar: write too long
time="2021-03-11T23:45:27Z" level=error msg="cannot read /tmp/errors go into sidecar-errors854995690/metadata-2.txt" error="read /tmp/errors go into sidecar-errors854995690/metadata-2.txt: is a directory"
time="2021-03-11T23:45:27Z" level=error msg="Failed to unmarshal /tmp/errors go into sidecar-errors854995690/metadata-3.txt" error="invalid character 'j' looking for beginning of value"
time="2021-03-11T23:45:27Z" level=error msg="Failed to open /tmp/note when a part has a problem823745470/test2-log.txt" error="open /tmp/note when a part has a problem823745470/test2-log.txt: no such file or directory"
FAIL

Anything else we need to know?: I’m not sure how to reproduce this or why it isn’t failing in CI. I’m hoping that Steve might have some ideas about what could be causing this.

/assign @stevekuznetsov /area prow/sidecar

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (14 by maintainers)

Most upvoted comments

This reproduces easily via bazel but not via go test:

$ bazel test //prow/sidecar:go_default_test
DEBUG: /home/alvaro/.cache/bazel/_bazel_alvaro/3216549e08482d14699602fa69f8e322/external/io_bazel_rules_go/go/private/context.bzl:497:14: WARNING: --features=race is no longer supported. Use --@io_bazel_rules_go//go/config:race instead.
DEBUG: /home/alvaro/.cache/bazel/_bazel_alvaro/3216549e08482d14699602fa69f8e322/external/bazel_gazelle/internal/go_repository.bzl:189:18: com_github_google_wire: gazelle: /home/alvaro/.cache/bazel/_bazel_alvaro/3216549e08482d14699602fa69f8e322/external/com_github_google_wire/internal/wire/testdata/NoopBuild/want/wire_gen.go: error reading go file: /home/alvaro/.cache/bazel/_bazel_alvaro/3216549e08482d14699602fa69f8e322/external/com_github_google_wire/internal/wire/testdata/NoopBuild/want/wire_gen.go:1:1: expected 'package', found 'EOF'
gazelle: finding module path for import example.com/bar: go get example.com/bar: unrecognized import path "example.com/bar": reading https://example.com/bar?go-get=1: 404 Not Found
gazelle: finding module path for import example.com/foo: go get example.com/foo: unrecognized import path "example.com/foo": reading https://example.com/foo?go-get=1: 404 Not Found
gazelle: finding module path for import example.com/bar: go get example.com/bar: unrecognized import path "example.com/bar": reading https://example.com/bar?go-get=1: 404 Not Found
gazelle: finding module path for import example.com/foo: go get example.com/foo: unrecognized import path "example.com/foo": reading https://example.com/foo?go-get=1: 404 Not Found
gazelle: finding module path for import example.com/bar: go get example.com/bar: unrecognized import path "example.com/bar": reading https://example.com/bar?go-get=1: 404 Not Found
gazelle: finding module path for import example.com/baz: go get example.com/baz: unrecognized import path "example.com/baz": reading https://example.com/baz?go-get=1: 404 Not Found
gazelle: finding module path for import example.com/foo: go get example.com/foo: unrecognized import path "example.com/foo": reading https://example.com/foo?go-get=1: 404 Not Found
gazelle: finding module path for import example.com/foo: go get example.com/foo: unrecognized import path "example.com/foo": reading https://example.com/foo?go-get=1: 404 Not Found
gazelle: finding module path for import example.com/bar: go get example.com/bar: unrecognized import path "example.com/bar": reading https://example.com/bar?go-get=1: 404 Not Found
gazelle: finding module path for import example.com/foo: go get example.com/foo: unrecognized import path "example.com/foo": reading https://example.com/foo?go-get=1: 404 Not Found
gazelle: finding module path for import example.com/bar: go get example.com/bar: unrecognized import path "example.com/bar": reading https://example.com/bar?go-get=1: 404 Not Found
gazelle: finding module path for import example.com/baz: go get example.com/baz: unrecognized import path "example.com/baz": reading https://example.com/baz?go-get=1: 404 Not Found
gazelle: finding module path for import example.com/foo: go get example.com/foo: unrecognized import path "example.com/foo": reading https://example.com/foo?go-get=1: 404 Not Found
gazelle: finding module path for import example.com/foo: go get example.com/foo: unrecognized import path "example.com/foo": reading https://example.com/foo?go-get=1: 404 Not Found
gazelle: finding module path for import example.com/foo: go get example.com/foo: unrecognized import path "example.com/foo": reading https://example.com/foo?go-get=1: 404 Not Found
gazelle: finding module path for import example.com/foo: go get example.com/foo: unrecognized import path "example.com/foo": reading https://example.com/foo?go-get=1: 404 Not Found
gazelle: finding module path for import example.com/bar: go get example.com/bar: unrecognized import path "example.com/bar": reading https://example.com/bar?go-get=1: 404 Not Found
gazelle: finding module path for import example.com/bar: go get example.com/bar: unrecognized import path "example.com/bar": reading https://example.com/bar?go-get=1: 404 Not Found
gazelle: finding module path for import example.com/baz: go get example.com/baz: unrecognized import path "example.com/baz": reading https://example.com/baz?go-get=1: 404 Not Found
gazelle: finding module path for import example.com/foo: go get example.com/foo: unrecognized import path "example.com/foo": reading https://example.com/foo?go-get=1: 404 Not Found
gazelle: finding module path for import example.com/bar: go get example.com/bar: unrecognized import path "example.com/bar": reading https://example.com/bar?go-get=1: 404 Not Found
gazelle: finding module path for import example.com/anon1: go get example.com/anon1: unrecognized import path "example.com/anon1": reading https://example.com/anon1?go-get=1: 404 Not Found
gazelle: finding module path for import example.com/anon2: go get example.com/anon2: unrecognized import path "example.com/anon2": reading https://example.com/anon2?go-get=1: 404 Not Found
gazelle: finding module path for import example.com/bar: go get example.com/bar: unrecognized import path "example.com/bar": reading https://example.com/bar?go-get=1: 404 Not Found
INFO: Analyzed target //prow/sidecar:go_default_test (1 packages loaded, 814 targets configured).
INFO: Found 1 test target...
FAIL: //prow/sidecar:go_default_test (see /home/alvaro/.cache/bazel/_bazel_alvaro/3216549e08482d14699602fa69f8e322/execroot/io_k8s_test_infra/bazel-out/k8-fastbuild/testlogs/prow/sidecar/go_default_test/test.log)
INFO: From Testing //prow/sidecar:go_default_test:
==================== Test output for //prow/sidecar:go_default_test:
--- FAIL: TestArchiveMatchesTar (0.00s)
    censor_test.go:170: failed to archive input: could not walk source files to archive them: could not tar file: archive/tar: write too long
--- FAIL: TestRoundTrip (0.00s)
    censor_test.go:213: failed to archive input: could not walk source files to archive them: could not tar file: archive/tar: write too long
time="2021-03-12T23:29:21Z" level=error msg="cannot read /tmp/errors go into sidecar-errors984193671/metadata-2.txt" error="read /tmp/errors go into sidecar-errors984193671/metadata-2.txt: is a directory"
time="2021-03-12T23:29:21Z" level=error msg="Failed to unmarshal /tmp/errors go into sidecar-errors984193671/metadata-3.txt" error="invalid character 'j' looking for beginning of value"
time="2021-03-12T23:29:21Z" level=error msg="Failed to open /tmp/note when a part has a problem318237355/test2-log.txt" error="open /tmp/note when a part has a problem318237355/test2-log.txt: no such file or directory"
FAIL
================================================================================
Target //prow/sidecar:go_default_test up-to-date:
  bazel-bin/prow/sidecar/go_default_test_/go_default_test
INFO: Elapsed time: 34.949s, Critical Path: 33.13s
INFO: 6 processes: 6 linux-sandbox.
INFO: Build completed, 1 test FAILED, 7 total actions
//prow/sidecar:go_default_test                                           FAILED in 31.2s
  /home/alvaro/.cache/bazel/_bazel_alvaro/3216549e08482d14699602fa69f8e322/execroot/io_k8s_test_infra/bazel-out/k8-fastbuild/testlogs/prow/sidecar/go_default_test/test.log

INFO: Build completed, 1 test FAILED, 7 total actions
$ go test ./prow/sidecar/
ok  	k8s.io/test-infra/prow/sidecar	61.123s