summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsh McKenzie <amckenzie@gitlab.com>2022-11-28 04:09:29 +0000
committerAsh McKenzie <amckenzie@gitlab.com>2022-11-28 04:09:29 +0000
commitf82854df305afbd051a039ba87cb4565de457d60 (patch)
tree0090a036ba3a72f033d66fd3fe2afc9f2c6bbb7a
parent75f184619640e1cd2fc820091064644df9b05279 (diff)
parentb42774409ff6780f4d5d335f732a60b807d61efa (diff)
downloadgitlab-shell-f82854df305afbd051a039ba87cb4565de457d60.tar.gz
Merge branch '602-fix-race-in-test' into 'main'
Use blocking reader to fix race in test Closes #602 See merge request https://gitlab.com/gitlab-org/gitlab-shell/-/merge_requests/700 Merged-by: Ash McKenzie <amckenzie@gitlab.com> Approved-by: Ash McKenzie <amckenzie@gitlab.com> Co-authored-by: Patrick Bajao <ebajao@gitlab.com>
-rw-r--r--internal/command/twofactorverify/twofactorverify_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/command/twofactorverify/twofactorverify_test.go b/internal/command/twofactorverify/twofactorverify_test.go
index fcc095f..640d3ed 100644
--- a/internal/command/twofactorverify/twofactorverify_test.go
+++ b/internal/command/twofactorverify/twofactorverify_test.go
@@ -177,7 +177,7 @@ func TestCanceledContext(t *testing.T) {
cmd := &Command{
Config: &config.Config{GitlabUrl: url},
Args: &commandargs.Shell{GitlabKeyId: "wait_infinitely"},
- ReadWriter: &readwriter.ReadWriter{Out: output, In: &bytes.Buffer{}},
+ ReadWriter: &readwriter.ReadWriter{Out: output, In: &blockingReader{}},
}
ctx, cancel := context.WithCancel(context.Background())