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(db/test): Flaky service insertion test #312

Closed
1 task
drochow opened this issue Oct 22, 2024 · 3 comments
Closed
1 task

fix(db/test): Flaky service insertion test #312

drochow opened this issue Oct 22, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@drochow
Copy link
Collaborator

drochow commented Oct 22, 2024

Task Description

Occationally fails:

______
• [FAILED] [0.151 seconds]
Service when Insert Service and we have 10 Services in the database [It] can insert correctly [database, Service, InsertService]
/home/runner/work/heureka/heureka/internal/database/mariadb/service_test.go:600

  Timeline >>
  STEP: throwing no error @ 10/22/24 06:54:29.056
  [FAILED] in [It] - /home/runner/work/heureka/heureka/internal/database/mariadb/service_test.go:604 @ 10/22/24 06:54:29.056
  << Timeline

  [FAILED] Expected
      <*errors.errorString | 0xc00194afe0>: 
      Error 1062 (23000): Duplicate entry 'Pughave' for key 'name_UNIQUE'
      {
          s: "Error 1062 (23000): Duplicate entry 'Pughave' for key 'name_UNIQUE'",
      }
  to be nil
  In [It] at: /home/runner/work/heureka/heureka/internal/database/mariadb/service_test.go:604 @ 10/22/24 06:54:29.056
------------------------------

Acceptance Criteria:

  • Able to run this specific test 100 times without an error
@drochow
Copy link
Collaborator Author

drochow commented Oct 22, 2024

image

@drochow
Copy link
Collaborator Author

drochow commented Oct 22, 2024

@dustindemmerle dustindemmerle self-assigned this Oct 22, 2024
@drochow drochow added the bug Something isn't working label Oct 22, 2024
@lolaapenna lolaapenna assigned MR2011 and unassigned dustindemmerle Oct 29, 2024
@MR2011
Copy link
Collaborator

MR2011 commented Nov 4, 2024

It looks like we already fixed this issue by adding a UUID to the Service CCRN to add more randomness:

func NewFakeBaseService() mariadb.BaseServiceRow {
	return mariadb.BaseServiceRow{
		CCRN: sql.NullString{String: fmt.Sprintf("%s-%s", gofakeit.AppName(), gofakeit.UUID()), Valid: true},
	}
}

@MR2011 MR2011 closed this as completed Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants