mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-22 15:43:49 +01:00
fix(session): race condition.
This commit is contained in:
@@ -111,13 +111,13 @@ func TestSessionClosedFlag(t *testing.T) {
|
||||
server := createMockServer()
|
||||
session := createMockSession(1, server)
|
||||
|
||||
if session.closed {
|
||||
if session.closed.Load() {
|
||||
t.Error("new session should not be closed")
|
||||
}
|
||||
|
||||
session.closed = true
|
||||
session.closed.Store(true)
|
||||
|
||||
if !session.closed {
|
||||
if !session.closed.Load() {
|
||||
t.Error("session closed flag should be settable")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user