Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
597 views

How to make vitest fail fast after first known test failure

I am using Vitest for testing and would like it to fail fast upon first error. The reason is that I'm using it within git bisect and don't need to waste time on the whole test run once there is an ...
Cornelius Roemer's user avatar
-1 votes
1 answer
46 views

Generate Fail Fast scenario using Multiple Thread in JAVA

I need a scenario to generate ConcurrentModificationException using multi-thread. Please have a look at the below code, here I am getting IllegalThreadStateException. Not sure why this is happening ...
D_B's user avatar
  • 481
27 votes
3 answers
5k views

Null checking with primary constructor in C# 12

I using C# 12. In C# 12 I can use primary constructor: public class UserService(IUnitOfWork uow) : IUserService { } Before C# 12 I used null checking for items that I inject in constructor: public ...
Milad Ahmadi's user avatar
1 vote
1 answer
920 views

Crash C# Application and Generate Dumps

I'm trying to generate dumps for my C# application, I used the FailFast method to "Immediately terminates a process after writing a message to the Windows Application event log, and then includes ...
dxtr's user avatar
  • 715
1 vote
1 answer
98 views

How can I change my Iterator to be a Fast-fail Iterator?

I'm trying to understand how to modify the Iterator of my Linked List to be fail-fast. I understand what it means for an Iterator to be fail-fast, but I don't know how exactly should I change my ...
May Sohatchevzzki's user avatar
1 vote
0 answers
3k views

Error : The application requested process termination through System.Environment.FailFast(string message)

i am in a little bit of a pickle, so about 3 weeks ago i start working on my own wpf project, for some reason when i minimize my window, it crashes (i am just using windowstate to minimize ) and my ...
Sye's user avatar
  • 17
4 votes
1 answer
296 views

is there a "fail fast" option for flutter tests?

to save time and money both locally and in CICD I would like to add "fail fast" to my flutter tests but I cannot find it in the official docs is there a way to do that?
aoatmon's user avatar
  • 597
-3 votes
1 answer
275 views

How can we handle the Java ConcurrentModificationException using try-catch?

I am trying to handle the java ConcurrentModificationException exception using try-catch block but still I am getting the same error when compiling the code. import java.util.*; public class failFast{ ...
Harshika Surasena's user avatar
0 votes
2 answers
2k views

Fail Fast When Kafka Consumer Can't Connect

For my own purposes, I need the Spring Boot application to stop if the Kafka Consumer can't connect to the broker. I mean, when Kafka Consumer trying to pool messages, we can see the following logs: [...
Oleksandr's user avatar
  • 522
1 vote
0 answers
851 views

Tomcat maxThreads & acceptCount tuning for Fail-Fast

I would like to tune Tomcat to fail-fast in case of any issues when all threads are occupied ( for example, waiting for a database connection if suddenly database starts to perform badly ). I checked ...
user3489820's user avatar
  • 1,519
2 votes
1 answer
346 views

java.util.ConcurrentModificationException while mutating an object

I am iterating over a List of CustomObject and while doing this iteration, I am mutating this object by adding a tag to tags list of this custom object. I am not adding or removing any CustomObject to ...
Mr Matrix's user avatar
  • 1,268
2 votes
1 answer
1k views

Spring boot app will not fail fast when custom transaction manager fails to connect

I am making a spring boot app with a custom transactionManager with its own datasource like so. Btw I'm using hikariCP as the datasource @Configuration @EnableTransactionManagement @...
anonuser1234's user avatar
1 vote
1 answer
1k views

Implementing a fail-fast design with promises in JavaScript

I'm not sure if "fail-fast" is the best way to describe this methodology, but ever since I started to learn about programming I have always been taught to design functions like this: function ...
Kenny83's user avatar
  • 904
4 votes
1 answer
63 views

Why I'm not getting ConcurrentModificationException while removing element from ArrayList during iteration [duplicate]

I am using the following code to loop through an arraylist and then removing one element from the arraylist. Here i'm expecting ConcurrentModificationException. But didn't get that exception. ...
Naveen's user avatar
  • 346
1 vote
2 answers
699 views

How Fail-fast Iterator works internally? [duplicate]

I know what is a fail-fast and fail-safe iterator. Fail-Fast iterators immediately throw ConcurrentModificationException if there is a structural modification of the collection. Fail-Safe doesn't ...
JAGRITI BANSAL's user avatar
9 votes
3 answers
30k views

How to use failFast in dynamic pipeline in Jenkins

I have pipeline which has dynamic parallel stages and I want my pipeline to fail fast, if any of the stage fail. I tried to add failFast: true but my pipeline is stuck at "Failed at Stage ABC". ...
aditi gupta's user avatar
-3 votes
1 answer
409 views

Linux: How to cat stdout of a process until the end, but stop and return a non-zero code if certain string appears?

We have a tool that runs tests, but does return an error code if they fail. The tool runs the tests after starting logging in through SSH to a custom console (not bash) and issuing a command. All ...
Ondra Žižka's user avatar
1 vote
2 answers
789 views

Will Environment.Exit(int) kill my application with treads running unmanaged code?

I have a windows service which runs unmanaged code (using DllImport) in different threads. Sometimes, the unmanaged code 'hangs'. Think of while (true) ;. When that happens, I need to kill the entire ...
Tvde1's user avatar
  • 1,284
0 votes
1 answer
445 views

How can I make JAXB to fail when a mandatory element is missing?

I'm trying to add some forward compatibility to a Java application calling a Web Service at work, but JAXB seems to behave backward on the subject... The application use the wsdl2java Maven plugin to ...
CidTori's user avatar
  • 409
1 vote
0 answers
703 views

Is there an elegant way run Go module tests with nested packages in parallel in a fail fast manner?

I have a Go project that uses modules. The module contains many packages, which are nested. When I let Go figure out the package structure by passing ./... to go test it runs the tests in parallel (...
Rok's user avatar
  • 827
1 vote
3 answers
453 views

Java - Will concurrent modification exception occur while using classic for loop?

Is there is a chance for getting concurrent modification exception occur while using classic for loop? import java.util.*; class IterTest{ public static void main(String[] args){ List<...
JavaUser's user avatar
  • 26.3k
1 vote
2 answers
986 views

What will Environment.FailFast do in .NET Core, when deployed to a Linux environment?

The docs for this method say: Immediately terminates a process after writing a message to the Windows Application event log, and then includes the message and optional exception information in ...
mikesigs's user avatar
  • 11.4k
1 vote
0 answers
199 views

throw exceptions for unknown Spring properties

I made a very silly mistake in my Spring Boot app's YAML config: --- spring: profiles: local ... ___ spring: profiles: foo ... --- spring: profiles: active: bar include: ...
Nate Glenn's user avatar
  • 6,712
1 vote
0 answers
68 views

Fail-Fast Iterator for an Stack

I want to implement a Fail-Fast Iterator to remove Entrys from my own List and test it on correct behaviour. The List holds Elements of the type MyEntry. These Entrys hold an Generic Value and a ...
Trikalium's user avatar
0 votes
1 answer
247 views

How to stop existing request execution to stop and just run fallback method in hystrix

In hystrix,I am using execution.isolation.thread.timeoutInMilliseconds this configuration to limit the response in some specific time else go for fallback method,But this setting is also executing the ...
Ankush Nakaskar's user avatar
2 votes
0 answers
36 views

ArrayList Failfast ConcurrentModificationException [duplicate]

package com.test; import java.util.ArrayList; import java.util.Iterator; public class TestList { public static void main(String[] args) { ArrayList<String> list = new ArrayList&...
Rajendra Lakshman Singh Thakur's user avatar
-1 votes
1 answer
2k views

Why we need fail fast and fail safe software design? [closed]

We know Java has fail-fast and fail-safe iteration design. I want to know , why we need these basically. Is there any fundamental reason for this separation? . What is the benefit of this design?. ...
JavaUser's user avatar
  • 26.3k
43 votes
5 answers
35k views

How to make Spring server to start even if database is down?

I'm using a Spring Boot(1.4.7) & MyBatis. spring.main1.datasource.url=jdbc:mariadb://192.168.0.11:3306/testdb?useUnicode=true&characterEncoding=utf8&autoReconnect=true&socketTimeout=...
Cs lee's user avatar
  • 443
2 votes
2 answers
72 views

Why isn't ConcurrentModificationException being thrown here?

Look at this little piece of code: ArrayList al = new ArrayList(); al.add("AA"); al.add("AB"); al.add("AC"); Iterator it = al.iterator(); while(it.hasNext()){ String s = (String)it.next(); if(s....
Aakash Verma's user avatar
  • 3,984
0 votes
1 answer
55 views

Fail Safe Fail Fast Example

ConcurrentHashMap<String, Integer> hm = new ConcurrentHashMap<>(); hm.put("1", 1); hm.put("2", 2); hm.put("3", 3); Iterator<String> itr = hm.keySet().iterator(); ...
VKN's user avatar
  • 1
1 vote
2 answers
93 views

Declaring an Iterator before adding elements to a Collection

If you create your own Iterable container class and retrieve a java.util.Iterator over its elements, is there any coding pattern according to which any further additions of elements in the container ...
Jason's user avatar
  • 2,885
1 vote
2 answers
520 views

bash on ubuntu 16: set -e not inheriting inside subshell

When I run this command set -e; echo $(echo "$-"); I get himBH as the output. I was expecting the letter e to be included in the output. Whats going on? I'm on Ubuntu 16.04.1 LTS with GNU bash, ...
american-ninja-warrior's user avatar
4 votes
0 answers
253 views

Protractor-fail-fast npm fails spec and doesn't run the rest specs (tests) in config file (using Protractor with Jasmine)

I have an issue while using npm protractor-fail-fast. ( https://www.npmjs.com/package/protractor-fail-fast ) If one spec file is failed, the rest specs will be NOT executed (NOT GOOD). I'm searching ...
Alex Svyatenko's user avatar
1 vote
0 answers
152 views

How do I throw an exception when I get multiple elements but I'm supposed to get only one?

I'm worried about this code: knex('person').where('id','=', 1).then(result => { const person = result[0]; // the code I worry - result should contain only ONE element }); If I was using C#, I ...
Hao's user avatar
  • 8,105
35 votes
3 answers
17k views

Gracefully handling corrupted state exceptions

Related to this question, I would like to force CLR to let my .NET 4.5.2 app catch Corrupted State Exceptions, for the sole purpose of logging them and then terminating the application. What's the ...
Lou's user avatar
  • 4,434
19 votes
2 answers
35k views

Hystrix Configuration

I am trying to implement hystrix for my application using hystrix-javanica. I have configured hystrix-configuration.properties as below hystrix.command.default.execution.isolation.strategy=SEMAPHORE ...
Jay's user avatar
  • 429
0 votes
2 answers
1k views

Multiple threads using iterator.remove() on a single collection returning fail-fast iterator

Oracle says Note that Iterator.remove is the only safe way to modify a collection during iteration; the behavior is unspecified if the underlying collection is modified in any other way while the ...
Aakash Verma's user avatar
  • 3,984
0 votes
1 answer
145 views

Why Hashmap fail-fast not happen in the resize function? (for multiple thread race condition issue)

All, I was trying to understand the multiple thread race condition issue for the Hashmap resize function. As I read from here. The race condition issue will cause the infinite loop link for the entry ...
Joe.wang's user avatar
  • 11.8k
1 vote
0 answers
121 views

Webservice functional/integration test with Junit

The question aims to find a better solution than mine. I have the following REQUIREMENTS for my integration tests: Each integration test is implemented in a single test class. The methods in a test ...
eventhorizon's user avatar
  • 3,347
3 votes
1 answer
83 views

Can I override `$` or `[[` to throw an error instead of NULL when asking for a missing list element?

My hunch is this is an abuse of the R language and there's a good reason this doesn't happen. But I find this to be a perpetual source of insidious errors in code that I'm trying to debug: MWE list....
Philip's user avatar
  • 7,293
0 votes
1 answer
81 views

Why Iterators fail fast and are they truly fail fast?

Iterators in Java are fail-fast. If an iterator values change while it is being iterated over, an exception is thrown. Is this purely to be safe? I am sure that in some cases, it doesn't matter that ...
More Than Five's user avatar
2 votes
7 answers
858 views

Fail fast iterators in Java

public class Alpha { public static void main(String[] args) { ArrayList<String> al = new ArrayList<String>(); al.add("a"); al.add("b"); al.add("c"); ...
Ramya's user avatar
  • 105
1 vote
0 answers
815 views

Spring Batch: OutOfMemoryError swallowed

As part of a larger application, I set up a Spring Batch job that is made up by just a chunk oriented tasklet: reader, processor and writer. The job is not run in the main thread. Occasionally the ...
danidemi's user avatar
  • 4,656
1 vote
1 answer
554 views

Why is generic instantiation syntax disallowed in Hack?

From the docs: Note: HHVM allows syntax such as $x = Vector<int>{5,10};, but Hack disallows the syntax in this situation, instead opting to infer it. Is there a specific reason for this?...
Maciej Sz's user avatar
  • 12k
2 votes
2 answers
2k views

How to make Storm halt on exception?

By default, when a Storm spout or bolt encounters an exception, it restarts the spout or bolt and tries again. Is there any configuration option to make it stop the topology, perhaps after N repeated ...
Jim Pivarski's user avatar
  • 5,944
1 vote
2 answers
630 views

Design by Contract and Fail Fast

Fail Fast - Fail-fast is a property of a system or module with respect to its response to failures. A fail-fast system is designed to immediately report at its interface any failure or ...
user2648176's user avatar
5 votes
5 answers
4k views

fail-fast iterator

I get this definition : As name suggest fail-fast Iterators fail as soon as they realized that structure of Collection has been changed since iteration has begun. what it mean by since iteration has ...
joy's user avatar
  • 741
2 votes
2 answers
753 views

Cannot understand this comment about fail-fast

In HashSet.java in JDK 1.6, there are some comments about the fail-fast property of HashSet's iterator. The iterators returned by this class's iterator method are fail-fast: if the set is modified ...
Heejin's user avatar
  • 4,573
-1 votes
4 answers
1k views

Why is there no error when using iterator.remove?

If I use Iterator.remove(), everything is fine. If I use ArryaList.remove(), I always receive the error java.util.ConcurrentModificationException. Can anyone point out the reason?
Adam Lee's user avatar
  • 25.7k
1 vote
0 answers
243 views

Detect if Serializable object is really serializable?

Is there a built-in method - or can someone point me to a good pattern - for determining whether an object that implements Serializable is actually serializable at construction time? I need something ...
Matt Mills's user avatar
  • 8,782