Skip to content

test: snmp input non-existing-directory #11122

@powersj

Description

@powersj

Relevant telegraf.conf

n/a

Logs from Telegraf

2022/05/17 14:43:11 W! [] No mibs found
2022/05/17 14:43:11 W! [] MIB path doesn't exist: "non-existing-directory"
--- FAIL: TestGosnmpWrapper_walk_retry (0.00s)
    snmp_test.go:563: 
        	Error Trace:	snmp_test.go:563
        	Error:      	Should not be: &net.UDPConn{conn:net.conn{fd:(*net.netFD)(0xc00049ab00)}}
        	Test:       	TestGosnmpWrapper_walk_retry
    snmp_test.go:564: 
        	Error Trace:	snmp_test.go:564
        	Error:      	Not equal: 
        	            	expected: 4
        	            	actual  : 2
        	Test:       	TestGosnmpWrapper_walk_retry
FAIL
FAIL	github.com/influxdata/telegraf/plugins/inputs/snmp	8.655s

System info

master

Docker

No response

Steps to reproduce

  1. go test -count=1 -race ./plugins/inputs/snmp

Expected behavior

test pass

Actual behavior

There are two failures from TestGosnmpWrapper_walk_retry

	assert.NotEqual(t, gs.Conn, conn)
	assert.Equal(t, (gs.Retries+1)*2, reqCount)

Additional info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/snmpbugunexpected problem or unintended behaviortesting requestAn issue that requires the tests to be updated

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions