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

webserver: fix live-test #2464

Merged
merged 2 commits into from
Aug 17, 2023
Merged

Conversation

ukane-philemon
Copy link
Contributor

These are just some changes I think the webserver live test can use. I think it needs more improvement and could work on them little by little.

  • Set "initErrors" to false to allow for error-free account creation.
  • Initiate and use math/rand.Rand instead of deprecated math/rand.Seed.
  • Set the Rate and MatchID feild for user order match.
  • Use caser.Title instead of deprecated string.Title.

- Set "initErrors" to false to allow for error free account creation.
- Initiate and use math/rand.Rand instead of deprecated math/rand.Seed.
- Set the Rate and MatchID feild for user order match.
- Use caser.Title instead of deprecated string.Title.

Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
Copy link
Member

@JoeGruffins JoeGruffins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually cannot run the tests on master because I have ipv6 turned off on my machine.

--- FAIL: TestServer (0.01s)
    live_test.go:2036: Connect error: connect failure: Can't listen on [::1]:54321. web server quitting: listen tcp [::1]:54321: socket: address family not supported by protocol

This diff seems to give me a panic:

$ go test --tags=live
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x531a58]

goroutine 1 [running]:
math/rand.(*Rand).Int63(...)
        /usr/lib/go/src/math/rand/rand.go:95
math/rand.(*Rand).Int31(...)
        /usr/lib/go/src/math/rand/rand.go:109
math/rand.(*Rand).Int31n(0x0, 0xa)
        /usr/lib/go/src/math/rand/rand.go:144 +0x38
math/rand.(*Rand).Intn(0x1736f60?, 0xc000041e60?)
        /usr/lib/go/src/math/rand/rand.go:182 +0x2e
decred.org/dcrdex/client/webserver.mkDexAsset({0x199f064, 0x3})
        /home/joe/git/dcrdex/client/webserver/live_test.go:236 +0xe5
decred.org/dcrdex/client/webserver.init()
        /home/joe/git/dcrdex/client/webserver/live_test.go:300 +0x594
exit status 2
FAIL    decred.org/dcrdex/client/webserver      0.023s

Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
@ukane-philemon
Copy link
Contributor Author

This diff seems to give me a panic:

Whoops! Fixed in fd6cb85. I also addressed this I actually cannot run the tests on master because I have ipv6 turned off on my machine..

Copy link
Member

@JoeGruffins JoeGruffins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for changing that!

@buck54321 buck54321 merged commit 3580da7 into decred:master Aug 17, 2023
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

Successfully merging this pull request may close these issues.

3 participants