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

Fix universe sync test #366

Merged
merged 2 commits into from
Jun 16, 2023
Merged

Fix universe sync test #366

merged 2 commits into from
Jun 16, 2023

Conversation

guggero
Copy link
Member

@guggero guggero commented Jun 16, 2023

Found while trying to reproduce a different error.
Looks like we didn't really compare the correct universe roots in the integration tests.

@@ -728,7 +728,7 @@ func assertUniverseStateEqual(t *testing.T, a, b *tapdHarness) {
rootsA, err := a.AssetRoots(ctxb, &unirpc.AssetRootRequest{})
require.NoError(t, err)

rootsB, err := a.AssetRoots(ctxb, &unirpc.AssetRootRequest{})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch

Copy link
Collaborator

@jharveyb jharveyb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! 💯

Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🧢

func assertUniverseStateEqual(t *testing.T, a, b *tapdHarness) {
ctxb := context.Background()

rootsA, err := a.AssetRoots(ctxb, &unirpc.AssetRootRequest{})
require.NoError(t, err)

rootsB, err := a.AssetRoots(ctxb, &unirpc.AssetRootRequest{})
rootsB, err := b.AssetRoots(ctxb, &unirpc.AssetRootRequest{})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙈


t.Helper()

require.Eventually(t, func() bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, this super useful!

Otherwise you need to modify things to return an error for the usual wait instances.

@Roasbeef Roasbeef added this pull request to the merge queue Jun 16, 2023
Merged via the queue into main with commit 14f08d8 Jun 16, 2023
11 checks passed
@jharveyb jharveyb deleted the fix-universe-sync-test branch July 5, 2023 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants