Blueprint-uServices / blueprint

Blueprint Microservices Compiler: Flexible and Configurable Open-Source Microservice Benchmark Applications
https://blueprint-uservices.github.io
BSD 3-Clause "New" or "Revised" License
20 stars 5 forks source link

[DSB Social Network] Getting Errors When Executing Tests for DSB_SN #177

Open ibraheemalsaghier opened 3 months ago

ibraheemalsaghier commented 3 months ago

When running the DSB social network I fail all of the tests. I am able to run the tests for all the other examples successfully. What could the issue be?

(goenv) user2:~/blueprint/examples/dsb_sn/tests$ go test

2024/06/09 11:56:05 Looking for user IDs in the database 2024/06/09 11:56:05 2024/06/09 11:56:35 server selection error: server selection timeout, current topology: { Type: Unknown, Servers: [{ Addr: localhost:27017, Type: Unknown, Last error: dial tcp [::1]:27017: connect: connection refused }, ] } --- FAIL: TestComposePost (30.03s) composepostservice_test.go:73: Error Trace: /home/saghieim/blueprint/examples/dsb_sn/tests/composepostservice_test.go:73 Error: Received unexpected error: server selection error: server selection timeout, current topology: { Type: Unknown, Servers: [{ Addr: localhost:27017, Type: Unknown, Last error: dial tcp [::1]:27017: connect: connection refused }, ] } Test: TestComposePost --- FAIL: TestWriteHomeTimeline (0.00s) hometimelineservice_test.go:68: CHecking hometimeline for 2 hometimelineservice_test.go:74: Error Trace: /home/saghieim/blueprint/examples/dsb_sn/tests/hometimelineservice_test.go:74 Error: "[{36874939883261200 1717934165268} {1 1717934195273645493}]" should have 1 item(s), but has 2 Test: TestWriteHomeTimeline hometimelineservice_test.go:214: cleanup hometimeline ids: [2 1 3 5] 2024/06/09 11:56:35 Looking for user IDs in the database 2024/06/09 11:56:35 830 18ffcdb825 0 2024/06/09 11:56:35 Looking for user IDs in the database --- FAIL: TestWriteUserTimeline (60.00s) usertimelineservice_test.go:78: Error Trace: /home/saghieim/blueprint/examples/dsb_sn/tests/usertimelineservice_test.go:78 Error: Received unexpected error: server selection error: server selection timeout, current topology: { Type: Unknown, Servers: [{ Addr: localhost:27017, Type: Unknown, Last error: dial tcp [::1]:27017: connect: connection refused }, ] } Test: TestWriteUserTimeline usertimelineservice_test.go:157: Error Trace: /home/saghieim/blueprint/examples/dsb_sn/tests/usertimelineservice_test.go:157 /home/saghieim/blueprint/examples/dsb_sn/tests/usertimelineservice_test.go:69 /home/saghieim/miniforge3/envs/goenv/go/src/runtime/panic.go:626 /home/saghieim/miniforge3/envs/goenv/go/src/testing/testing.go:1005 /home/saghieim/blueprint/examples/dsb_sn/tests/usertimelineservice_test.go:78 Error: Received unexpected error: server selection error: server selection timeout, current topology: { Type: Unknown, Servers: [{ Addr: localhost:27017, Type: Unknown, Last error: dial tcp [::1]:27017: connect: connection refused }, ] } Test: TestWriteUserTimeline --- FAIL: TestReadUserTimeline (60.00s) usertimelineservice_test.go:122: Error Trace: /home/saghieim/blueprint/examples/dsb_sn/tests/usertimelineservice_test.go:122 Error: Received unexpected error: server selection error: server selection timeout, current topology: { Type: Unknown, Servers: [{ Addr: localhost:27017, Type: Unknown, Last error: dial tcp [::1]:27017: connect: connection refused }, ] } Test: TestReadUserTimeline usertimelineservice_test.go:157: Error Trace: /home/saghieim/blueprint/examples/dsb_sn/tests/usertimelineservice_test.go:157 /home/saghieim/blueprint/examples/dsb_sn/tests/usertimelineservice_test.go:114 /home/saghieim/miniforge3/envs/goenv/go/src/runtime/panic.go:626 /home/saghieim/miniforge3/envs/goenv/go/src/testing/testing.go:1005 /home/saghieim/blueprint/examples/dsb_sn/tests/usertimelineservice_test.go:122 Error: Received unexpected error: server selection error: server selection timeout, current topology: { Type: Unknown, Servers: [{ Addr: localhost:27017, Type: Unknown, Last error: dial tcp [::1]:27017: connect: connection refused }, ] } Test: TestReadUserTimeline 2024/06/09 11:58:35 INFO ServiceRegistry "wrk2api_service" building client "local" 2024/06/09 11:58:35 830 18ffcdd572 0 2024/06/09 11:58:35 2024/06/09 11:59:05 server selection error: server selection timeout, current topology: { Type: Unknown, Servers: [{ Addr: localhost:27017, Type: Unknown, Last error: dial tcp [::1]:27017: connect: connection refused }, ] } 2024/06/09 11:59:05 Cleaning up database --- FAIL: TestWrk2Compose (60.01s) wrk2apiservice_test.go:271: Error Trace: /home/saghieim/blueprint/examples/dsb_sn/tests/wrk2apiservice_test.go:271 Error: Received unexpected error: server selection error: server selection timeout, current topology: { Type: Unknown, Servers: [{ Addr: localhost:27017, Type: Unknown, Last error: dial tcp [::1]:27017: connect: connection refused }, ] } Test: TestWrk2Compose wrk2apiservice_test.go:303: Error Trace: /home/saghieim/blueprint/examples/dsb_sn/tests/wrk2apiservice_test.go:303 /home/saghieim/blueprint/examples/dsb_sn/tests/wrk2apiservice_test.go:229 /home/saghieim/miniforge3/envs/goenv/go/src/runtime/panic.go:626 /home/saghieim/miniforge3/envs/goenv/go/src/testing/testing.go:1005 /home/saghieim/blueprint/examples/dsb_sn/tests/wrk2apiservice_test.go:271 Error: Received unexpected error: server selection error: server selection timeout, current topology: { Type: Unknown, Servers: [{ Addr: localhost:27017, Type: Unknown, Last error: dial tcp [::1]:27017: connect: connection refused }, ] } Test: TestWrk2Compose --- FAIL: TestWrk2ReadTimelines (0.00s) wrk2apiservice_test.go:315: Error Trace: /home/saghieim/blueprint/examples/dsb_sn/tests/wrk2apiservice_test.go:315 Error: Received unexpected error: Username already registered Test: TestWrk2ReadTimelines FAIL exit status 1 FAIL github.com/blueprint-uservices/blueprint/examples/dsb_sn/tests 210.111s

vaastav commented 3 months ago

The social network tests are currently unit tests (and not blueprint-style full end-to-end tests). This means that to run them correctly, they need an external mongodb server running at localhost:27017. The tests can't seem to find it which is why you get these errors. The tests are something that we are currently changing in one of the other dev branches so expect an update soon.