brocaar / chirpstack-network-server

ChirpStack Network Server is an open-source LoRaWAN network-server.
https://www.chirpstack.io
MIT License
1.48k stars 545 forks source link

Tests stuck #580

Closed sergorl closed 2 years ago

sergorl commented 2 years ago

What happened?

Tests stuck.

What did you expect?

Test should be passed or not.

Steps to reproduce this issue

Steps:

  1. make test

Could you share your log output?

Running tests
adr/structs.go:97:1: exported method HandlerRPCServer.ID should have comment or be unexported
adr/structs.go:103:1: exported method HandlerRPCServer.Name should have comment or be unexported
adr/structs.go:109:1: exported method HandlerRPCServer.Handle should have comment or be unexported
adr/structs.go:120:1: exported method HandlerRPC.ID should have comment or be unexported
adr/structs.go:126:1: exported method HandlerRPC.Name should have comment or be unexported
adr/structs.go:132:1: exported method HandlerRPC.Handle should have comment or be unexported
adr/structs.go:144:1: exported method HandlerPlugin.Server should have comment or be unexported
adr/structs.go:148:1: exported method HandlerPlugin.Client should have comment or be unexported
examples/adr-plugin/main.go:10:1: comment on exported type Handler should be of the form "Handler ..." (with optional leading article)
internal/api/ns/api.go:20:1: exported function Setup should have comment or be unexported
internal/api/ns/network_server.go:1029:1: receiver name c should be consistent with previous receiver name n for NetworkServerAPI
internal/api/roaming/roaming.go:366:9: if block ends with a return statement, so drop this else and outdent its block
internal/backend/controller/nop_client.go:20:1: comment on exported method NopNetworkControllerClient.HandleDownlinkMetaData should be of the form "HandleDownlinkMetaData ..."
internal/backend/gateway/amqp/amqp.go:77:1: exported method Backend.SendTXPacket should have comment or be unexported
internal/backend/gateway/amqp/amqp.go:96:1: exported method Backend.SendGatewayConfigPacket should have comment or be unexported
internal/backend/gateway/amqp/amqp.go:108:1: exported method Backend.RXPacketChan should have comment or be unexported
internal/backend/gateway/amqp/amqp.go:112:1: exported method Backend.StatsPacketChan should have comment or be unexported
internal/backend/gateway/amqp/amqp.go:116:1: exported method Backend.DownlinkTXAckChan should have comment or be unexported
internal/backend/gateway/amqp/amqp.go:120:1: exported method Backend.Close should have comment or be unexported
internal/backend/gateway/amqp/amqp.go:397:21: error strings should not be capitalized or end with punctuation or a newline
internal/backend/gateway/amqp/channel_pool.go:67:8: should omit values from range; this loop is equivalent to `for range ...`
internal/backend/gateway/azureiothub/azureiothub.go:154:1: exported method Backend.SendTXPacket should have comment or be unexported
internal/backend/gateway/azureiothub/azureiothub.go:173:1: exported method Backend.SendGatewayConfigPacket should have comment or be unexported
internal/backend/gateway/azureiothub/azureiothub.go:185:1: exported method Backend.RXPacketChan should have comment or be unexported
internal/backend/gateway/azureiothub/azureiothub.go:189:1: exported method Backend.StatsPacketChan should have comment or be unexported
internal/backend/gateway/azureiothub/azureiothub.go:193:1: exported method Backend.DownlinkTXAckChan should have comment or be unexported
internal/backend/gateway/azureiothub/azureiothub.go:197:1: exported method Backend.Close should have comment or be unexported
internal/config/config.go:241:6: exported type RoamingServer should have comment or be unexported
internal/config/config.go:256:6: exported type DefaultRoamingServer should have comment or be unexported
internal/config/config.go:270:6: exported type KEK should have comment or be unexported
internal/downlink/ack/ack_roaming_hns.go:10:1: comment on exported function HandleRoamingTxAck should be of the form "HandleRoamingTxAck ..."
internal/downlink/data/data.go:791:11: if block ends with a return statement, so drop this else and outdent its block
internal/downlink/join/join.go:94:21: error strings should not be capitalized or end with punctuation or a newline
internal/downlink/roaming/roaming.go:50:1: exported function EmitPRDownlink should have comment or be unexported
internal/gateway/stats/stats.go:22:5: exported var ErrAbort should have comment or be unexported
internal/logging/logging.go:53:1: exported function UnaryClientCtxIDInterceptor should have comment or be unexported
internal/migrations/code/test/code_test.go:30:1: receiver name ts should be consistent with previous receiver name b for MigrateTestSuite
internal/roaming/dl_metadata.go:11:1: comment on exported function DLMetaDataToUplinkRXInfoSet should be of the form "DLMetaDataToUplinkRXInfoSet ..."
internal/roaming/ul_metadata.go:17:1: exported function ULMetaDataToTXInfo should have comment or be unexported
internal/roaming/ul_metadata.go:35:1: exported function ULMetaDataToRXInfo should have comment or be unexported
internal/roaming/ul_metadata.go:86:1: exported function RecvTimeFromRXInfo should have comment or be unexported
internal/roaming/ul_metadata.go:101:1: exported function RXInfoToGWInfo should have comment or be unexported
internal/uplink/join/join_roaming_sns.go:12:1: comment on exported function HandleStartPRHNS should be of the form "HandleStartPRHNS ..."
?       github.com/brocaar/chirpstack-network-server/v3/adr     [no test files]
?       github.com/brocaar/chirpstack-network-server/v3/cmd/chirpstack-network-server   [no test files]
?       github.com/brocaar/chirpstack-network-server/v3/cmd/chirpstack-network-server/cmd       [no test files]
?       github.com/brocaar/chirpstack-network-server/v3/examples/adr-plugin     [no test files]
=== RUN   TestADR
=== RUN   TestADR/GetHandler
--- PASS: TestADR (0.00s)
    --- PASS: TestADR/GetHandler (0.00s)
=== RUN   TestDefaultHandler
=== RUN   TestDefaultHandler/ID
=== RUN   TestDefaultHandler/getPacketLossPercentage
=== RUN   TestDefaultHandler/getNbTrans
=== RUN   TestDefaultHandler/getNbTrans/packetloss_rate:_4.990000,_current_nbTrans:_3
=== RUN   TestDefaultHandler/getNbTrans/packetloss_rate:_9.990000,_current_nbTrans:_2
=== RUN   TestDefaultHandler/getNbTrans/packetloss_rate:_29.990000,_current_nbTrans:_1
=== RUN   TestDefaultHandler/getNbTrans/packetloss_rate:_30.000000,_current_nbTrans:_3
=== RUN   TestDefaultHandler/getIdealTxPowerIndexAndDR
=== RUN   TestDefaultHandler/getIdealTxPowerIndexAndDR/nothing_to_adjust
=== RUN   TestDefaultHandler/getIdealTxPowerIndexAndDR/one_step:_one_step_data-rate_increase
=== RUN   TestDefaultHandler/getIdealTxPowerIndexAndDR/one_step:_one_step_tx-power_decrease
=== RUN   TestDefaultHandler/getIdealTxPowerIndexAndDR/two_steps:_two_steps_data-rate_increase
=== RUN   TestDefaultHandler/getIdealTxPowerIndexAndDR/two_steps:_one_step_data-rate_increase,_one_step_tx-power_decrease
=== RUN   TestDefaultHandler/getIdealTxPowerIndexAndDR/two_step_tx-power_decrease
=== RUN   TestDefaultHandler/getIdealTxPowerIndexAndDR/stwo_steps:_one_step_tx-power_decrease
=== RUN   TestDefaultHandler/getIdealTxPowerIndexAndDR/one_negative_step:_one_step_power_increase
=== RUN   TestDefaultHandler/getIdealTxPowerIndexAndDR/one_negative_step:_nothing_to_do_(adr_engine_will_not_decrease_dr)
=== RUN   TestDefaultHandler/getIdealTxPowerIndexAndDR/10_negative_steps,_should_not_adjust_anything_(as_we_already_reached_the_min_tx-power_index)
=== RUN   TestDefaultHandler/requiredHistoryCount
=== RUN   TestDefaultHandler/getMaxSNR
=== RUN   TestDefaultHandler/Handle
=== RUN   TestDefaultHandler/Handle/max_dr_exceeded,_adr_disabled
=== RUN   TestDefaultHandler/Handle/max_dr_exceeded,_decrease_dr
=== RUN   TestDefaultHandler/Handle/increase_dr
--- PASS: TestDefaultHandler (0.00s)
    --- PASS: TestDefaultHandler/ID (0.00s)
    --- PASS: TestDefaultHandler/getPacketLossPercentage (0.00s)
    --- PASS: TestDefaultHandler/getNbTrans (0.00s)
        --- PASS: TestDefaultHandler/getNbTrans/packetloss_rate:_4.990000,_current_nbTrans:_3 (0.00s)
        --- PASS: TestDefaultHandler/getNbTrans/packetloss_rate:_9.990000,_current_nbTrans:_2 (0.00s)
        --- PASS: TestDefaultHandler/getNbTrans/packetloss_rate:_29.990000,_current_nbTrans:_1 (0.00s)
        --- PASS: TestDefaultHandler/getNbTrans/packetloss_rate:_30.000000,_current_nbTrans:_3 (0.00s)
    --- PASS: TestDefaultHandler/getIdealTxPowerIndexAndDR (0.00s)
        --- PASS: TestDefaultHandler/getIdealTxPowerIndexAndDR/nothing_to_adjust (0.00s)
        --- PASS: TestDefaultHandler/getIdealTxPowerIndexAndDR/one_step:_one_step_data-rate_increase (0.00s)
        --- PASS: TestDefaultHandler/getIdealTxPowerIndexAndDR/one_step:_one_step_tx-power_decrease (0.00s)
        --- PASS: TestDefaultHandler/getIdealTxPowerIndexAndDR/two_steps:_two_steps_data-rate_increase (0.00s)
        --- PASS: TestDefaultHandler/getIdealTxPowerIndexAndDR/two_steps:_one_step_data-rate_increase,_one_step_tx-power_decrease (0.00s)
        --- PASS: TestDefaultHandler/getIdealTxPowerIndexAndDR/two_step_tx-power_decrease (0.00s)
        --- PASS: TestDefaultHandler/getIdealTxPowerIndexAndDR/stwo_steps:_one_step_tx-power_decrease (0.00s)
        --- PASS: TestDefaultHandler/getIdealTxPowerIndexAndDR/one_negative_step:_one_step_power_increase (0.00s)
        --- PASS: TestDefaultHandler/getIdealTxPowerIndexAndDR/one_negative_step:_nothing_to_do_(adr_engine_will_not_decrease_dr) (0.00s)
        --- PASS: TestDefaultHandler/getIdealTxPowerIndexAndDR/10_negative_steps,_should_not_adjust_anything_(as_we_already_reached_the_min_tx-power_index) (0.00s)
    --- PASS: TestDefaultHandler/requiredHistoryCount (0.00s)
    --- PASS: TestDefaultHandler/getMaxSNR (0.00s)
    --- PASS: TestDefaultHandler/Handle (0.00s)
        --- PASS: TestDefaultHandler/Handle/max_dr_exceeded,_adr_disabled (0.00s)
        --- PASS: TestDefaultHandler/Handle/max_dr_exceeded,_decrease_dr (0.00s)
        --- PASS: TestDefaultHandler/Handle/increase_dr (0.00s)
=== RUN   TestLoRaLRFHSSHandler
=== RUN   TestLoRaLRFHSSHandler/ID
=== RUN   TestLoRaLRFHSSHandler/Handle
=== RUN   TestLoRaLRFHSSHandler/Handle/switch_to_DR_3_(LoRa)
=== RUN   TestLoRaLRFHSSHandler/Handle/switch_to_DR_3_(LoRa)#01
--- PASS: TestLoRaLRFHSSHandler (0.00s)
    --- PASS: TestLoRaLRFHSSHandler/ID (0.00s)
    --- PASS: TestLoRaLRFHSSHandler/Handle (0.00s)
        --- PASS: TestLoRaLRFHSSHandler/Handle/switch_to_DR_3_(LoRa) (0.00s)
        --- PASS: TestLoRaLRFHSSHandler/Handle/switch_to_DR_3_(LoRa)#01 (0.00s)
=== RUN   TestLRFHSSHandler
=== RUN   TestLRFHSSHandler/ID
=== RUN   TestLRFHSSHandler/Handle_without_LR-FHSS_enabled
=== RUN   TestLRFHSSHandler/Handle
=== RUN   TestLRFHSSHandler/Handle/adr_disabled
=== RUN   TestLRFHSSHandler/Handle/max_dr._prevents_lr-fhss
=== RUN   TestLRFHSSHandler/Handle/switch_to_dr_10
=== RUN   TestLRFHSSHandler/Handle/switch_to_dr_11
--- PASS: TestLRFHSSHandler (0.00s)
    --- PASS: TestLRFHSSHandler/ID (0.00s)
    --- PASS: TestLRFHSSHandler/Handle_without_LR-FHSS_enabled (0.00s)
    --- PASS: TestLRFHSSHandler/Handle (0.00s)
        --- PASS: TestLRFHSSHandler/Handle/adr_disabled (0.00s)
        --- PASS: TestLRFHSSHandler/Handle/max_dr._prevents_lr-fhss (0.00s)
        --- PASS: TestLRFHSSHandler/Handle/switch_to_dr_10 (0.00s)
        --- PASS: TestLRFHSSHandler/Handle/switch_to_dr_11 (0.00s)
PASS
coverage: 78.0% of statements
ok      github.com/brocaar/chirpstack-network-server/v3/internal/adr    0.009s  coverage: 78.0% of statements
?       github.com/brocaar/chirpstack-network-server/v3/internal/api/client/asclient    [no test files]
=== RUN   TestNetworkServerAPINew

Your Environment

Component Version
Application Server 3.17.6
Network Server 3.16.1
Gateway Bridge 3.13.2
Chirpstack API
Geolocation
Concentratord
brocaar commented 2 years ago

Are you using the provided docker-compose environment?

sergorl commented 2 years ago

@brocaar , no, I use master branch from this repository. Then I build it and run tests.

brocaar commented 2 years ago

Please use the provided docker-compose environment. It comes with all required dependencies already setup for you. It is very likely that the tests are hanging because of failing db connection etc... E.g.

# Enter development shell
docker-compose run --rm chirpstack-network-server bash

# Within development shell
make test