Skip to content

Commit

Permalink
Add xfail to flaky tests (#1087)
Browse files Browse the repository at this point in the history
#### Reference Issues/PRs
issue #496

#### What does this implement or fix?
As agreed today, I am adding xfail to the tests that need to be
investigated as part of issue #496 .
The xfails will be removed when the tests are no longer flaky.
  • Loading branch information
G-D-Petrov authored Nov 21, 2023
1 parent de61bb5 commit b61d359
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions python/tests/hypothesis/arcticdb/test_append.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def test_(initial: InputFactories, append: InputFactories, match, swap, lmdb_ver
df_in_str=st.booleans(),
)
@SLOW_TESTS_MARK
@pytest.mark.xfail(reason="Needs to be fixed with issue #496")
def test_append_with_defragmentation(
sym,
col_per_append_df,
Expand Down
3 changes: 3 additions & 0 deletions python/tests/unit/arcticdb/version_store/test_aggregation.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ def test_hypothesis_sum_agg(lmdb_version_store, df):
received_df.replace(-np.inf, np.nan, inplace=True)
received_df.replace(np.inf, np.nan, inplace=True)

expected_df.replace(-np.inf, np.nan, inplace=True)
expected_df.replace(np.inf, np.nan, inplace=True)

assert_frame_equal(expected_df, received_df)


Expand Down
13 changes: 7 additions & 6 deletions python/tests/unit/arcticdb/version_store/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import pytest

from arcticdb.exceptions import NoSuchVersionException, NoDataFoundException
from arcticdb.util.test import distinct_timestamps


def test_read_descriptor(lmdb_version_store, one_col_df):
Expand Down Expand Up @@ -53,25 +54,25 @@ def test_column_names_by_timestamp(lmdb_version_store, one_col_df, two_col_df):
symbol = "test_column_names_by_timestamp"

# Write a DF with a single column
lmdb_version_store.write(symbol, one_col_df())
after_one_col_write = Timestamp.now(tz="UTC")
with distinct_timestamps(lmdb_version_store) as first_write_timestamp:
lmdb_version_store.write(symbol, one_col_df())

# Ensure the timestamps differ
time.sleep(0.1)

lmdb_version_store.write(symbol, two_col_df())
after_two_col_write = Timestamp.now(tz="UTC")
with distinct_timestamps(lmdb_version_store) as second_write_timestamp:
lmdb_version_store.write(symbol, two_col_df())

# Assert querying with a time before the first write raises an exception
with pytest.raises(NoDataFoundException) as excinfo:
lmdb_version_store.column_names(symbol, as_of=Timestamp("1970-01-01", tz="UTC"))
assert issubclass(excinfo.type, NoSuchVersionException)

# Assert query with the timestamp after the one col write returns only a single column
assert lmdb_version_store.column_names(symbol, as_of=after_one_col_write) == ["x"]
assert lmdb_version_store.column_names(symbol, as_of=first_write_timestamp.after) == ["x"]

# Assert query with the timestamp after the two col write returns two columns
assert lmdb_version_store.column_names(symbol, as_of=after_two_col_write) == ["x", "y"]
assert lmdb_version_store.column_names(symbol, as_of=second_write_timestamp.after) == ["x", "y"]


def test_get_num_rows(lmdb_version_store, two_col_df):
Expand Down
1 change: 1 addition & 0 deletions python/tests/unit/arcticdb/version_store/test_append.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ def test_append_mix_ascending_descending(lmdb_version_store):
assert info["sorted"] == "UNSORTED"


@pytest.mark.xfail(reason="Needs to be fixed with issue #496")
def test_append_with_cont_mem_problem(sym, lmdb_version_store_tiny_segment_dynamic):
set_config_int("SymbolDataCompact.SegmentCount", 1)
df0 = pd.DataFrame({"0": ["01234567890123456"]}, index=[pd.Timestamp(0)])
Expand Down
2 changes: 1 addition & 1 deletion python/tests/unit/arcticdb/version_store/test_filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ def test_filter_numeric_isin_unsigned(lmdb_version_store):
df=dataframes_with_names_and_dtypes(["a"], integral_type_strategies()),
vals=st.frozensets(unsigned_integral_type_strategies(), min_size=1),
)
@pytest.mark.skipif(PANDAS_VERSION < Version("1.2"), reason="Early Pandas filtering does not handle unsigned well")
@pytest.mark.skipif(PANDAS_VERSION < Version("2.0.0"), reason="Early Pandas filtering does not handle unsigned well")
def test_filter_numeric_isnotin_unsigned(lmdb_version_store, df, vals):
assume(not df.empty)
q = QueryBuilder()
Expand Down

0 comments on commit b61d359

Please sign in to comment.