(t *testing.T)
| 157 | } |
| 158 | |
| 159 | func TestRuntimeStore_SessionAccess(t *testing.T) { |
| 160 | // Use a separate store for this test to avoid race conditions |
| 161 | testStore := NewRuntimeStore(NewDefaultRuntimeConfig()) |
| 162 | testValue := make(map[interface{}]interface{}) |
| 163 | testValue["foo"] = "bar" |
| 164 | |
| 165 | testStore.SessionUpdate(NewSessionState(testStore, "test_access_session", testValue)) |
| 166 | |
| 167 | // Get initial state |
| 168 | state, _ := testStore.SessionRead("test_access_session") |
| 169 | if state == nil { |
| 170 | t.Fatal("Failed to read session") |
| 171 | } |
| 172 | |
| 173 | // SessionAccess should update timeAccessed |
| 174 | // Note: We don't directly access timeAccessed to avoid race conditions |
| 175 | // Instead we verify the operation completes without error |
| 176 | err := testStore.SessionAccess("test_access_session") |
| 177 | if err != nil { |
| 178 | t.Errorf("SessionAccess failed: %v", err) |
| 179 | } |
| 180 | |
| 181 | // Verify session still exists after access |
| 182 | if !testStore.SessionExist("test_access_session") { |
| 183 | t.Error("Session should still exist after access") |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | /** |
| 188 | 性能测试 | 基准测试 |
nothing calls this directly
no test coverage detected