Skip to content

Commit

Permalink
Avoid running a certain test at an hour when it always fails
Browse files Browse the repository at this point in the history
  • Loading branch information
amberin committed Apr 11, 2024
1 parent a68cedf commit 3035421
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.startsWith;
import static org.junit.Assume.assumeTrue;

import android.icu.util.Calendar;
import android.widget.DatePicker;
import android.widget.TextView;
import android.widget.TimePicker;
Expand All @@ -58,7 +60,9 @@ public class QueryFragmentTest extends OrgzlyTest {
@Override
public void tearDown() throws Exception {
super.tearDown();
scenario.close();
if (scenario != null) {
scenario.close();
}
}

private void defaultSetUp() {
Expand Down Expand Up @@ -811,11 +815,14 @@ public void testInactiveDeadline() {
onNotesInSearch().check(matches(recyclerViewItemCount(0)));
}

// FIXME: Fails at an hour (or less) from midnight
@Test
public void testScheduledTimestamp() {
Calendar calendar = Calendar.getInstance();
// Skip this test if current time is less than an hour before midnight
assumeTrue(calendar.get(Calendar.HOUR_OF_DAY) < 23);
final long currentTime = calendar.getTimeInMillis();
String inOneHour = new OrgDateTime.Builder()
.setDateTime(System.currentTimeMillis() + 1000 * 60 * 60)
.setDateTime(currentTime + 1000 * 60 * 60)
.setHasTime(true)
.setIsActive(true)
.build()
Expand Down

0 comments on commit 3035421

Please sign in to comment.