TykTechnologies / tyk

Tyk Open Source API Gateway written in Go, supporting REST, GraphQL, TCP and gRPC protocols
Other
9.65k stars 1.08k forks source link

Tests not running #2492

Closed williamokano closed 4 years ago

williamokano commented 5 years ago

Branch/Environment/Version

Describe the bug When I execute make test one of the tests fail on master branch.

Reproduction steps

  1. git clone git@github.com:TykTechnologies/tyk.git
  2. make build
  3. make test

Actual behavior The tests fail.

Expected behavior Should pass all the tests

Screenshots/Video error_tyk_test

Logs (debug mode or log file):

time="Sep 07 00:08:05" level=info msg="Disabled feature" prefix=coprocess
--- FAIL: TestKeyHandler (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
    panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0xe235e2]

goroutine 2118 [running]:
testing.tRunner.func1(0xc420ac0a50)
    /home/william/.asdf/installs/golang/1.10.8/go/src/testing/testing.go:742 +0x29d
panic(0x1093f80, 0x1bc5640)
    /home/william/.asdf/installs/golang/1.10.8/go/src/runtime/panic.go:502 +0x229
github.com/TykTechnologies/tyk/gateway.(*proxyMux).swap(0x1bf7180, 0xc422f2a7c8)
    /home/william/go/packages/src/github.com/TykTechnologies/tyk/gateway/proxy_muxer.go:313 +0x3c2
github.com/TykTechnologies/tyk/gateway.startServer()
    /home/william/go/packages/src/github.com/TykTechnologies/tyk/gateway/server.go:1235 +0x2da
github.com/TykTechnologies/tyk/gateway.(*Test).Start(0xc421b5d600)
    /home/william/go/packages/src/github.com/TykTechnologies/tyk/gateway/testutil.go:570 +0x28d
github.com/TykTechnologies/tyk/gateway.StartTest(0x0, 0x0, 0x0, 0xc4229b7d30)
    /home/william/go/packages/src/github.com/TykTechnologies/tyk/gateway/testutil.go:697 +0x77
github.com/TykTechnologies/tyk/gateway.TestKeyHandler(0xc420ac0a50)
    /home/william/go/packages/src/github.com/TykTechnologies/tyk/gateway/api_test.go:132 +0x47
testing.tRunner(0xc420ac0a50, 0x12ca828)
    /home/william/.asdf/installs/golang/1.10.8/go/src/testing/testing.go:777 +0xd0
created by testing.(*T).Run
    /home/william/.asdf/installs/golang/1.10.8/go/src/testing/testing.go:824 +0x2e0
FAIL    github.com/TykTechnologies/tyk/gateway  0.353s

Configuration (tyk config file):

{
    "hostname": "",
    "listen_address": "",
    "listen_port": 8080,
    "control_api_hostname": "",
    "control_api_port": 0,
    "secret": "352d20ee67be67f6340b4c0605b044b7",
    "node_secret": "",
    "pid_file_location": "",
    "allow_insecure_configs": false,
    "public_key_path": "",
    "allow_remote_config": false,
    "security": {
        "private_certificate_encoding_secret": "",
        "control_api_use_mutual_tls": false,
        "pinned_public_keys": null,
        "certificates": {
            "apis": null,
            "upstream": null,
            "control_api": null,
            "dashboard_api": null,
            "mdcb_api": null
        }
    },
    "http_server_options": {
        "override_defaults": false,
        "read_timeout": 0,
        "write_timeout": 0,
        "use_ssl": false,
        "use_ssl_le": false,
        "enable_http2": false,
        "ssl_insecure_skip_verify": false,
        "enable_websockets": false,
        "certificates": null,
        "ssl_certificates": null,
        "server_name": "",
        "min_version": 0,
        "flush_interval": 0,
        "skip_url_cleaning": false,
        "skip_target_path_escaping": false,
        "ssl_ciphers": null
    },
    "reload_wait_time": 0,
    "version_header": "",
    "optimisations_use_async_session_write": false,
    "suppress_redis_signal_reload": false,
    "hash_keys": false,
    "hash_key_function": "",
    "enable_hashed_keys_listing": false,
    "min_token_length": 0,
    "enable_api_segregation": false,
    "template_path": "/home/william/go/packages/src/github.com/TykTechnologies/tyk/templates",
    "policies": {
        "policy_source": "",
        "policy_connection_string": "",
        "policy_record_name": "policies/policies.json",
        "allow_explicit_policy_id": false
    },
    "disabled_ports": null,
    "app_path": "apps/",
    "use_db_app_configs": false,
    "db_app_conf_options": {
        "connection_string": "",
        "node_is_segmented": false,
        "tags": null
    },
    "storage": {
        "type": "redis",
        "host": "localhost",
        "port": 6379,
        "hosts": null,
        "username": "",
        "password": "",
        "database": 0,
        "optimisation_max_idle": 100,
        "optimisation_max_active": 0,
        "timeout": 0,
        "enable_cluster": false,
        "use_ssl": false,
        "ssl_insecure_skip_verify": false
    },
    "disable_dashboard_zeroconf": false,
    "slave_options": {
        "use_rpc": false,
        "use_ssl": false,
        "ssl_insecure_skip_verify": false,
        "connection_string": "",
        "rpc_key": "",
        "api_key": "",
        "enable_rpc_cache": false,
        "bind_to_slugs": false,
        "disable_keyspace_sync": false,
        "group_id": "",
        "call_timeout": 0,
        "ping_timeout": 0,
        "rpc_pool_size": 0
    },
    "management_node": false,
    "auth_override": {
        "force_auth_provider": false,
        "auth_provider": {
            "name": "",
            "storage_engine": "",
            "meta": null
        },
        "force_session_provider": false,
        "session_provider": {
            "name": "",
            "storage_engine": "",
            "meta": null
        }
    },
    "enable_non_transactional_rate_limiter": false,
    "enable_sentinel_rate_limiter": false,
    "enable_redis_rolling_limiter": false,
    "drl_notification_frequency": 0,
    "enforce_org_data_age": false,
    "enforce_org_data_detail_logging": false,
    "enforce_org_quotas": false,
    "experimental_process_org_off_thread": false,
    "monitor": {
        "enable_trigger_monitors": false,
        "configuration": {
            "method": "",
            "target_path": "",
            "template_path": "",
            "header_map": null,
            "event_timeout": 0
        },
        "global_trigger_limit": 0,
        "monitor_user_keys": false,
        "monitor_org_keys": false
    },
    "max_idle_connections": 0,
    "max_idle_connections_per_host": 0,
    "max_conn_time": 0,
    "close_idle_connections": false,
    "close_connections": false,
    "enable_custom_domains": false,
    "allow_master_keys": false,
    "service_discovery": {
        "default_cache_timeout": 0
    },
    "proxy_ssl_insecure_skip_verify": false,
    "proxy_enable_http2": false,
    "proxy_ssl_min_version": 0,
    "proxy_ssl_ciphers": null,
    "proxy_default_timeout": 0,
    "proxy_ssl_disable_renegotiation": false,
    "proxy_close_connections": false,
    "uptime_tests": {
        "disable": false,
        "config": {
            "failure_trigger_sample_size": 0,
            "time_wait": 0,
            "checker_pool_size": 0,
            "enable_uptime_analytics": false
        }
    },
    "health_check": {
        "enable_health_checks": false,
        "health_check_value_timeouts": 0
    },
    "oauth_refresh_token_expire": 0,
    "oauth_token_expire": 0,
    "oauth_token_expired_retain_period": 0,
    "oauth_redirect_uri_separator": "",
    "enable_key_logging": false,
    "enable_analytics": false,
    "analytics_config": {
        "type": "",
        "ignored_ips": [],
        "enable_detailed_recording": false,
        "enable_geo_ip": false,
        "geo_ip_db_path": "",
        "normalise_urls": {
            "enabled": false,
            "normalise_uuids": false,
            "normalise_numbers": false,
            "custom_patterns": null
        },
        "pool_size": 0,
        "records_buffer_size": 0,
        "storage_expiration_time": 0
    },
    "dns_cache": {
        "enabled": false,
        "ttl": 3600,
        "multiple_ips_handle_strategy": "no_cache"
    },
    "disable_regexp_cache": false,
    "regexp_cache_expire": 0,
    "local_session_cache": {
        "disable_cached_session_state": false,
        "cached_session_timeout": 0,
        "cached_session_eviction": 0
    },
    "enable_separate_cache_store": false,
    "cache_storage": {
        "type": "",
        "host": "",
        "port": 0,
        "hosts": null,
        "username": "",
        "password": "",
        "database": 0,
        "optimisation_max_idle": 0,
        "optimisation_max_active": 0,
        "timeout": 0,
        "enable_cluster": false,
        "use_ssl": false,
        "ssl_insecure_skip_verify": false
    },
    "enable_bundle_downloader": false,
    "bundle_base_url": "",
    "enable_jsvm": false,
    "jsvm_timeout": 0,
    "disable_virtual_path_blobs": false,
    "tyk_js_path": "",
    "middleware_path": "middleware",
    "coprocess_options": {
        "enable_coprocess": false,
        "coprocess_grpc_server": "",
        "python_path_prefix": ""
    },
    "log_level": "",
    "health_check_endpoint_name": "",
    "tracing": {
        "name": "",
        "enabled": false,
        "options": null
    },
    "newrelic": {
        "app_name": "",
        "license_key": ""
    },
    "enable_http_profiler": false,
    "use_redis_log": false,
    "sentry_code": "",
    "use_sentry": false,
    "use_syslog": false,
    "use_graylog": false,
    "use_logstash": false,
    "graylog_network_addr": "",
    "logstash_network_addr": "",
    "syslog_transport": "",
    "logstash_transport": "",
    "syslog_network_addr": "",
    "statsd_connection_string": "",
    "statsd_prefix": "",
    "event_handlers": {
        "events": null
    },
    "event_trigers_defunct": null,
    "event_triggers_defunct": null,
    "session_update_pool_size": 0,
    "session_update_buffer_size": 0,
    "suppress_default_org_store": false,
    "legacy_enable_allowance_countdown": false,
    "global_session_lifetime": 0,
    "force_global_session_lifetime": false,
    "hide_generator_header": false
}

Additional context

$ go env

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/william/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/william/go/packages"
GORACE=""
GOROOT="/home/william/.asdf/installs/golang/1.10.8/go"
GOTMPDIR=""
GOTOOLDIR="/home/william/.asdf/installs/golang/1.10.8/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build445838108=/tmp/go-build -gno-record-gcc-switches"
stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, please add comments to this ticket if you would like it to stay open. Thank you for your contributions.