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

[v15] Deflake TestRootUTMPEntryExists #49778

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions integration/utmp_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ func TestRootUTMPEntryExists(t *testing.T) {
require.NoError(t, err)

require.EventuallyWithTf(t, func(collect *assert.CollectT) {
require.NoError(collect, uacc.UserWithPtyInDatabase(s.utmpPath, teleportTestUser))
require.NoError(collect, uacc.UserWithPtyInDatabase(s.wtmpPath, teleportTestUser))
assert.NoError(collect, uacc.UserWithPtyInDatabase(s.utmpPath, teleportTestUser))
assert.NoError(collect, uacc.UserWithPtyInDatabase(s.wtmpPath, teleportTestUser))
// Ensure than an entry was not written to btmp.
require.True(collect, trace.IsNotFound(uacc.UserWithPtyInDatabase(s.btmpPath, teleportTestUser)), "unexpected error: %v", err)
assert.True(collect, trace.IsNotFound(uacc.UserWithPtyInDatabase(s.btmpPath, teleportTestUser)), "unexpected error: %v", err)
}, 5*time.Minute, time.Second, "did not detect utmp entry within 5 minutes")
})

Expand Down Expand Up @@ -152,10 +152,10 @@ func TestRootUTMPEntryExists(t *testing.T) {
require.NoError(t, err)

require.EventuallyWithT(t, func(collect *assert.CollectT) {
require.NoError(collect, uacc.UserWithPtyInDatabase(s.btmpPath, teleportFakeUser))
assert.NoError(collect, uacc.UserWithPtyInDatabase(s.btmpPath, teleportFakeUser))
// Ensure that entries were not written to utmp and wtmp
require.True(collect, trace.IsNotFound(uacc.UserWithPtyInDatabase(s.utmpPath, teleportFakeUser)), "unexpected error: %v", err)
require.True(collect, trace.IsNotFound(uacc.UserWithPtyInDatabase(s.wtmpPath, teleportFakeUser)), "unexpected error: %v", err)
assert.True(collect, trace.IsNotFound(uacc.UserWithPtyInDatabase(s.utmpPath, teleportFakeUser)), "unexpected error: %v", err)
assert.True(collect, trace.IsNotFound(uacc.UserWithPtyInDatabase(s.wtmpPath, teleportFakeUser)), "unexpected error: %v", err)
}, 5*time.Minute, time.Second, "did not detect btmp entry within 5 minutes")
})

Expand Down
Loading