Merge branch 'fix/reassign-secret-token-on-generate' into 'master'
Reassign secret token when regenerating one ## What does this MR do? This is an attempt to fix intermittent errors in out test suite. ```text Failures: 1) Gitlab::Shell memoized secret_token creates and links the secret token file Failure/Error: expect(File.read(secret_file).chomp).to eq(secret_token) expected: "690f959e206ab91acc54e1c605c7ff90" got: "cccb4e8df9360600271e61114d4e6e68" (compared using ==) # ./spec/lib/gitlab/backend/shell_spec.rb:47:in `block (3 levels) in <top (required)>' ``` It appears that `spec/lib/gitlab/backend/shell_spec.rb` tries to change the file that stores secret token, but `Gitlab::Shell` memoizes `@secret_token` on class level, so when it was already created by other tests (`spec/requests/api/internal_spec.rb` in this case), memoized token is not reassigned even if it was generated again with `ensure_secret_token!`. See merge request !6844
Showing
Please register or sign in to comment