Fix flaky ndjson reader spec
What does this MR do?
In the test case setup it uses tar xzvf #{archive} &> /dev/null
to prepare the fixture. However this will be translated into a background job for some shell (like in some environment (such as Ubuntu bash shell). But it works as foreground job in some other environment(such as MacOS bash shell).ksh
)
We still do not know why different CI runners behave differently: some run I had this wrong perception. After some more search, it appears it is just depends on how fast the background job runs in CI runners. #213843 (comment 324477257). We have been able to simulate the failure locally.tar
command in background, most run tar
command foreground. But we know the background job triggers the spec failure.
This is very likely the reason why in #213843 (closed) we see sometimes Gitlab::ImportExport::JSON::NdjsonReader#exist? given valid dir_path is expected to equal true failing
.
Detailed analysis is at #213843 (comment 323118864)
The fix is to remove &
to avoid the ambiguity in different shells environments.
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Closes #213843 (closed)