Skip to content

Commit

Permalink
fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
mlin committed Feb 28, 2023
1 parent 591712b commit 2e9c7db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
Binary file added test/NA12878.chr21:20000000-22500000.bam
Binary file not shown.
15 changes: 5 additions & 10 deletions test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import subprocess
import multiprocessing
import tempfile
import shlex
import json
import contextlib
import time
Expand Down Expand Up @@ -181,21 +181,16 @@ def test_vacuum(tmpdir, chinook_file):
assert len(actual) == 15632


@pytest.mark.skip(reason="flaky")
def test_sam(tmpdir):
(region, expected_posflag) = ("chr21:20000000-25000000", 27074190881221)
(region, expected_posflag) = ("chr21:20000000-22500000", 12601293751857)
# (region, expected_posflag) = ("chr21:20000000-25000000", 27074190881221)
# (region, expected_posflag) = ("chr21:20000000-40000000", 148853599470365)
page_size = 16384
outer_page_size = 65536
level = 9
bam_path = os.path.join(os.path.dirname(__file__), "NA12878.chr21:20000000-22500000.bam")
subprocess.run(
f"samtools view -O BAM -@ 4 -o {region}.bam https://s3.amazonaws.com/1000genomes/1000G_2504_high_coverage/data/ERR3239334/NA12878.final.cram {region}",
check=True,
shell=True,
cwd=tmpdir,
)
subprocess.run(
f"samtools view {region}.bam | zstd -8 -T0 - -o {region}.sam.zst",
f"samtools view {shlex.quote(bam_path)} | zstd -8 -T0 - -o {region}.sam.zst",
check=True,
shell=True,
cwd=tmpdir,
Expand Down

0 comments on commit 2e9c7db

Please sign in to comment.