Skip to content

Commit

Permalink
Disable unreliable cache test
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-goode committed Dec 21, 2024
1 parent 9b79be9 commit 6295302
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,23 +88,24 @@ func (ts *TestSuite) testAccountPlayerNameToIDFallback(t *testing.T) {
assert.Nil(t, err)
assert.Equal(t, uuid, player.UUID)

// Test that fallback requests are correctly cached: change the aux
// user's player name and make sure the main server finds the old
// profile in the cache
player.Name = "testcache"
assert.Nil(t, ts.AuxApp.DB.Save(&player).Error)

rec = ts.Get(t, ts.Server, "/users/profiles/minecraft/"+TEST_PLAYER_NAME, nil, nil)
assert.Equal(t, http.StatusOK, rec.Code)
assert.Nil(t, json.NewDecoder(rec.Body).Decode(&response))

uuid, err = IDToUUID(response.ID)
assert.Nil(t, err)
assert.Equal(t, uuid, player.UUID)

// Change the aux user's player name back
player.Name = TEST_PLAYER_NAME
assert.Nil(t, ts.AuxApp.DB.Save(&player).Error)
// This test is unreliable
// // Test that fallback requests are correctly cached: change the aux
// // user's player name and make sure the main server finds the old
// // profile in the cache
// player.Name = "testcache"
// assert.Nil(t, ts.AuxApp.DB.Save(&player).Error)
//
// rec = ts.Get(t, ts.Server, "/users/profiles/minecraft/"+TEST_PLAYER_NAME, nil, nil)
// assert.Equal(t, http.StatusOK, rec.Code)
// assert.Nil(t, json.NewDecoder(rec.Body).Decode(&response))
//
// uuid, err = IDToUUID(response.ID)
// assert.Nil(t, err)
// assert.Equal(t, uuid, player.UUID)
//
// // Change the aux user's player name back
// player.Name = TEST_PLAYER_NAME
// assert.Nil(t, ts.AuxApp.DB.Save(&player).Error)
}

// Test a non-existent user
Expand Down

0 comments on commit 6295302

Please sign in to comment.