Skip to content

tests: sql output bind path does not exist #11112

@powersj

Description

@powersj

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/[email protected]/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/[email protected]/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/[email protected]/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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugunexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions