Comments (7)
Since you give a fixed port there can't be multiple (mini)redises running at the same time, but
go test
runs separate packages in parallel by default. Try running go test with:go test -p=1 etc
, so it'll only run a single test at the same time.
It works! Thanks a lot
from miniredis.
from miniredis.
/go/pkg/mod/github.com/alicebob/miniredis/[email protected]/server/server.go:122 +0x3c
That's https://github.com/alicebob/miniredis/blob/master/server/server.go#L122
s.mu.Lock()
I don't get the error locally, and looking at the code, might it be that you start a redis server in a Go routine, and it's not ready starting yet when you use it? Would it otherwise be possible to make a standalone test case?
from miniredis.
@alicebob Thanks for investigation! I didn't start redis on go routine, instead I put it on a init() func, and start on a fixed port.
if addr != "" {
return addr, "", 0, tls, nil
}
log.Info().Msg("No redis set on env, start mini redis.")
mr := miniredis.NewMiniRedis()
mr.StartAddr(":15678")
addr = mr.Addr()
return addr, "", 0, tls, nil
That's very strange, I met the panic only if set -coverpkg=./...
on go test
from miniredis.
from miniredis.
Since you give a fixed port there can't be multiple (mini)redises running at the same time, but go test
runs separate packages in parallel by default. Try running go test with: go test -p=1 etc
, so it'll only run a single test at the same time.
from miniredis.
@alicebob aha, got the errMsg
panic: listen tcp :15678: bind: address already in use
It seems -coverpkg=./...
makes the tests run concurrence between different package.
from miniredis.
Related Issues (20)
- expire time invalid HOT 5
- RESP3 Issues HOT 9
- Wrong behavior with SET NX GET HOT 4
- how can i know the miniredis was close HOT 2
- MEMORY USAGE command HOT 2
- Special lastId=$ not working with XREAD HOT 2
- Blocking calls from lua always deadlock HOT 4
- Discrepancy with LSET after copying a list HOT 2
- redis: can't parse array/set/push HOT 6
- not support mock err HOT 1
- Slow SPOP command due to re-sorting HOT 2
- Last release v2.30.5 has incorrect tag HOT 1
- Last release v2.30.5 has incorrect tag HOT 3
- Feature Request: `CLIENT` Command Not Supported HOT 2
- Using embedded subscribe and external client leads to io timeout HOT 5
- Feature Request: ZINTER command HOT 2
- GEOSEARCH support
- Support for checking lack of hash tag in redis cluster mode
- Ignore `redis.set_repl` in miniredis
- Allow redis server to connect on specified Port number instead of Random Port HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from miniredis.