Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ibraheemalsaghier opened this issue Jun 9, 2024 · 1 comment

Comments

@ibraheemalsaghier
Copy link

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
Copy link
Contributor

vaastav commented Jun 10, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants