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

tests: sql output bind path does not exist #11112

Closed
powersj opened this issue May 17, 2022 · 1 comment
Closed

tests: sql output bind path does not exist #11112

powersj opened this issue May 17, 2022 · 1 comment
Labels
bug unexpected problem or unintended behavior

Comments

@powersj
Copy link
Contributor

powersj commented May 17, 2022

Relevant telegraf.conf

n/a

Logs from Telegraf

2022/05/17 11:08:14 Starting container id: 2f6e2d0356f4 image: testcontainers/ryuk:0.3.3
2022/05/17 11:08:14 Waiting for container id 2f6e2d0356f4 image: testcontainers/ryuk:0.3.3
2022/05/17 11:08:14 Container is ready id: 2f6e2d0356f4 image: testcontainers/ryuk:0.3.3
--- FAIL: TestMysqlIntegration (0.82s)
    sql_test.go:191: 
        	Error Trace:	sql_test.go:191
        	Error:      	Received unexpected error:
        	            	Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /docker-entrypoint-initdb.d
        	            	failed to create container
        	            	github.com/testcontainers/testcontainers-go.GenericContainer
        	            		/home/powersj/go/pkg/mod/github.com/testcontainers/testcontainers-go@v0.12.0/generic.go:45
        	            	github.com/influxdata/telegraf/plugins/outputs/sql.TestMysqlIntegration
        	            		/home/powersj/telegraf/plugins/outputs/sql/sql_test.go:190
        	            	testing.tRunner
        	            		/usr/lib/go/src/testing/testing.go:1439
        	            	runtime.goexit
        	            		/usr/lib/go/src/runtime/asm_amd64.s:1571
        	Test:       	TestMysqlIntegration
        	Messages:   	starting container failed
--- FAIL: TestPostgresIntegration (0.01s)
    sql_test.go:279: 
        	Error Trace:	sql_test.go:279
        	Error:      	Received unexpected error:
        	            	Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /docker-entrypoint-initdb.d
        	            	failed to create container
        	            	github.com/testcontainers/testcontainers-go.GenericContainer
        	            		/home/powersj/go/pkg/mod/github.com/testcontainers/testcontainers-go@v0.12.0/generic.go:45
        	            	github.com/influxdata/telegraf/plugins/outputs/sql.TestPostgresIntegration
        	            		/home/powersj/telegraf/plugins/outputs/sql/sql_test.go:278
        	            	testing.tRunner
        	            		/usr/lib/go/src/testing/testing.go:1439
        	            	runtime.goexit
        	            		/usr/lib/go/src/runtime/asm_amd64.s:1571
        	Test:       	TestPostgresIntegration
        	Messages:   	starting container failed
--- FAIL: TestClickHouseIntegration (0.01s)
    sql_test.go:376: 
        	Error Trace:	sql_test.go:376
        	Error:      	Received unexpected error:
        	            	Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /docker-entrypoint-initdb.d
        	            	failed to create container
        	            	github.com/testcontainers/testcontainers-go.GenericContainer
        	            		/home/powersj/go/pkg/mod/github.com/testcontainers/testcontainers-go@v0.12.0/generic.go:45
        	            	github.com/influxdata/telegraf/plugins/outputs/sql.TestClickHouseIntegration
        	            		/home/powersj/telegraf/plugins/outputs/sql/sql_test.go:375
        	            	testing.tRunner
        	            		/usr/lib/go/src/testing/testing.go:1439
        	            	runtime.goexit
        	            		/usr/lib/go/src/runtime/asm_amd64.s:1571
        	Test:       	TestClickHouseIntegration
        	Messages:   	starting container failed
FAIL
FAIL	github.com/influxdata/telegraf/plugins/outputs/sql	0.937s

System info

master

Docker

No response

Steps to reproduce

  1. docker-compse up
  2. go test -count=1 -race -timeout 30s ./plugins/outputs/sql/...

Expected behavior

tests to pass

Actual behavior

The test containers initialization fails with mount config issues:

Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /docker-entrypoint-initdb.d

The code uses:

			BindMounts: map[string]string{
				initdb: "/docker-entrypoint-initdb.d",
				outDir: "/out",
			},

However, it seems the order was swapped testcontainers/testcontainers-go#354 late last year.

Additional info

No response

@powersj powersj added the bug unexpected problem or unintended behavior label May 17, 2022
powersj added a commit to powersj/telegraf that referenced this issue May 17, 2022
@powersj
Copy link
Contributor Author

powersj commented May 17, 2022

Fixed in #11114

@powersj powersj closed this as completed May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant