Skip to content

Fix flaky ndjson reader spec

Qingyu Zhao requested to merge 213843-fix-flaky-ndjson-reader-spec into master

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 ksh) in some environment (such as Ubuntu bash shell). But it works as foreground job in some other environment(such as MacOS bash shell).

We still do not know why different CI runners behave differently: some run tar command in background, most run tar command foreground. But we know the background job triggers the spec failure. 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.

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

Closes #213843 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports